Forked from MarinaVector/gist:116b9ea56dd373bda10976b00cee9070
Last active
January 29, 2024 12:03
-
-
Save graceman9/140655249a23523877e5555798a82a5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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