Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save graceman9/140655249a23523877e5555798a82a5f to your computer and use it in GitHub Desktop.
Save graceman9/140655249a23523877e5555798a82a5f to your computer and use it in GitHub Desktop.
version: '3.7'
services:
php-fpm:
build: docker
container_name: 'php'
ports:
- '9001:9001'
volumes:
- ./:/app
working_dir: /app
nginx:
image: nginx
container_name: 'nginx'
working_dir: /app
ports:
- '7777:80'
volumes:
- ./:/app
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
#---------------------------------------------------
#Dockerfile
#
#------------------------------------------------
FROM php:8.1-fpm-alpine
# Install dev dependencies
RUN apk update \
&& apk upgrade --available \
&& apk add --virtual build-deps \
autoconf \
build-base \
icu-dev \
libevent-dev \
openssl-dev \
zlib-dev \
libzip \
libzip-dev \
zlib \
zlib-dev \
bzip2 \
git \
libpng \
libpng-dev \
libjpeg \
libjpeg-turbo-dev \
libwebp-dev \
freetype \
freetype-dev \
postgresql-dev \
curl \
wget \
bash
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
# Install PHP extensions
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) \
intl \
gd \
bcmath \
pdo_pgsql \
sockets \
zip
RUN pecl channel-update pecl.php.net \
&& pecl install -o -f \
redis \
event \
&& rm -rf /tmp/pear \
&& echo "extension=redis.so" > /usr/local/etc/php/conf.d/redis.ini \
&& echo "extension=event.so" > /usr/local/etc/php/conf.d/event.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment