parent
cb8b1ce5c7
commit
2cf871cd13
|
@ -1,19 +1,27 @@
|
||||||
version: '3.7'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
nginx:
|
||||||
image: php:8.2-apache
|
image: nginx
|
||||||
container_name: my-php-app
|
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- 8081:80
|
||||||
volumes:
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||||
- ./app:/var/www/html
|
- ./app:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
composer:
|
composer:
|
||||||
image: composer:latest
|
image: composer
|
||||||
container_name: composer-container
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app
|
- ./app:/app
|
||||||
working_dir: /app
|
command: install --no-dev
|
||||||
depends_on:
|
|
||||||
- web
|
php:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: php.Dockerfile
|
||||||
|
volumes:
|
||||||
|
- ./app:/var/www/html
|
||||||
|
- ./php.ini:/usr/local/etc/php/php.ini
|
||||||
|
restart: unless-stopped
|
|
@ -0,0 +1,21 @@
|
||||||
|
events {}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
index index.php index.html;
|
||||||
|
#error_log /var/log/nginx/error.log;
|
||||||
|
#access_log /var/log/nginx/access.log;
|
||||||
|
root /var/www/html;
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_pass php:9000;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
FROM php:8.2-fpm-alpine
|
||||||
|
|
||||||
|
# Install dependencies for GD and install GD with support for jpeg, png webp and freetype
|
||||||
|
# Info about installing GD in PHP https://www.php.net/manual/en/image.installation.php
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
libjpeg-turbo-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libwebp-dev \
|
||||||
|
freetype-dev
|
||||||
|
|
||||||
|
# As of PHP 7.4 we don't need to add --with-png
|
||||||
|
RUN docker-php-ext-configure gd --with-jpeg --with-webp --with-freetype
|
||||||
|
RUN docker-php-ext-install gd
|
Loading…
Reference in New Issue