From 74e59f1ccf87d0f8b50a141a2c2614202ae8b040 Mon Sep 17 00:00:00 2001 From: maxpozdeev Date: Fri, 24 Mar 2023 23:21:37 +0300 Subject: [PATCH] add dev-docker for php-fpm 8.2 + nginx --- docker/dev/_nginx/Dockerfile-nginx-alpine | 5 +++++ docker/dev/mtt-php81-nginx/.env | 1 - docker/dev/mtt-php81-nginx/Dockerfile-fpm | 11 ----------- docker/dev/mtt-php82-nginx/.env | 1 + docker/dev/mtt-php82-nginx/Dockerfile-fpm | 12 ++++++++++++ .../{mtt-php81-nginx => mtt-php82-nginx}/compose.yml | 7 ++++--- docker/dev/mtt-php82-nginx/php-fpm-www.conf | 12 ++++++++++++ .../{mtt-php81-nginx => mtt-php82-nginx}/php-mtt.ini | 0 .../php-opcache.ini | 0 9 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 docker/dev/_nginx/Dockerfile-nginx-alpine delete mode 100644 docker/dev/mtt-php81-nginx/.env delete mode 100644 docker/dev/mtt-php81-nginx/Dockerfile-fpm create mode 100644 docker/dev/mtt-php82-nginx/.env create mode 100644 docker/dev/mtt-php82-nginx/Dockerfile-fpm rename docker/dev/{mtt-php81-nginx => mtt-php82-nginx}/compose.yml (83%) create mode 100644 docker/dev/mtt-php82-nginx/php-fpm-www.conf rename docker/dev/{mtt-php81-nginx => mtt-php82-nginx}/php-mtt.ini (100%) rename docker/dev/{mtt-php81-nginx => mtt-php82-nginx}/php-opcache.ini (100%) diff --git a/docker/dev/_nginx/Dockerfile-nginx-alpine b/docker/dev/_nginx/Dockerfile-nginx-alpine new file mode 100644 index 0000000..1312e5b --- /dev/null +++ b/docker/dev/_nginx/Dockerfile-nginx-alpine @@ -0,0 +1,5 @@ +FROM nginx:alpine + +COPY default.conf /etc/nginx/conf.d/ + +VOLUME /var/www/html diff --git a/docker/dev/mtt-php81-nginx/.env b/docker/dev/mtt-php81-nginx/.env deleted file mode 100644 index f2087fd..0000000 --- a/docker/dev/mtt-php81-nginx/.env +++ /dev/null @@ -1 +0,0 @@ -PLATFORM_NAME=mtt-dev-php81-nginx diff --git a/docker/dev/mtt-php81-nginx/Dockerfile-fpm b/docker/dev/mtt-php81-nginx/Dockerfile-fpm deleted file mode 100644 index fbfefe4..0000000 --- a/docker/dev/mtt-php81-nginx/Dockerfile-fpm +++ /dev/null @@ -1,11 +0,0 @@ -FROM php:8.1-fpm - -RUN docker-php-ext-install mysqli && \ - mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \ - mkdir /var/www/phpinfo && \ - echo " /var/www/phpinfo/phpinfo.php - -#COPY php-mtt.ini /usr/local/etc/php/conf.d/ -#COPY php-opcache.ini /usr/local/etc/php/conf.d/ - -VOLUME /var/www/html diff --git a/docker/dev/mtt-php82-nginx/.env b/docker/dev/mtt-php82-nginx/.env new file mode 100644 index 0000000..aa353f2 --- /dev/null +++ b/docker/dev/mtt-php82-nginx/.env @@ -0,0 +1 @@ +PLATFORM_NAME=mtt-dev-php82-nginx-alpine diff --git a/docker/dev/mtt-php82-nginx/Dockerfile-fpm b/docker/dev/mtt-php82-nginx/Dockerfile-fpm new file mode 100644 index 0000000..3497a3a --- /dev/null +++ b/docker/dev/mtt-php82-nginx/Dockerfile-fpm @@ -0,0 +1,12 @@ +FROM php:8.2-fpm-alpine + +RUN docker-php-ext-install pdo_mysql && \ + mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \ + mkdir /var/www/phpinfo && \ + echo " /var/www/phpinfo/phpinfo.php + +#COPY php-mtt.ini /usr/local/etc/php/conf.d/ +#COPY php-opcache.ini /usr/local/etc/php/conf.d/ +COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf + +VOLUME /var/www/html diff --git a/docker/dev/mtt-php81-nginx/compose.yml b/docker/dev/mtt-php82-nginx/compose.yml similarity index 83% rename from docker/dev/mtt-php81-nginx/compose.yml rename to docker/dev/mtt-php82-nginx/compose.yml index 7e8e41a..7a3a81a 100644 --- a/docker/dev/mtt-php81-nginx/compose.yml +++ b/docker/dev/mtt-php82-nginx/compose.yml @@ -8,8 +8,8 @@ services: web: build: context: ../_nginx - dockerfile: Dockerfile-nginx - image: mtt-dev/nginx + dockerfile: Dockerfile-nginx-alpine + image: mtt-dev/nginx:alpine container_name: ${PLATFORM_NAME}-web ports: - "8080:80" @@ -24,12 +24,13 @@ services: build: context: . dockerfile: Dockerfile-fpm - image: mtt-dev/php:8.1-fpm + image: mtt-dev/php:8.2-fpm-alpine container_name: ${PLATFORM_NAME}-fpm hostname: php-fpm environment: - MTT_ENABLE_DEBUG=YES - MTT_DB_TYPE=sqlite + - MTT_API_USE_PATH_INFO=YES volumes: - ../../../src:/var/www/html - ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini diff --git a/docker/dev/mtt-php82-nginx/php-fpm-www.conf b/docker/dev/mtt-php82-nginx/php-fpm-www.conf new file mode 100644 index 0000000..b162e94 --- /dev/null +++ b/docker/dev/mtt-php82-nginx/php-fpm-www.conf @@ -0,0 +1,12 @@ +[www] +user = www-data +group = www-data +listen = 127.0.0.1:9000 +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +pm.max_requests = 500 + +access.format = "%R - %u [%t] \"%m %r\" %s %f" diff --git a/docker/dev/mtt-php81-nginx/php-mtt.ini b/docker/dev/mtt-php82-nginx/php-mtt.ini similarity index 100% rename from docker/dev/mtt-php81-nginx/php-mtt.ini rename to docker/dev/mtt-php82-nginx/php-mtt.ini diff --git a/docker/dev/mtt-php81-nginx/php-opcache.ini b/docker/dev/mtt-php82-nginx/php-opcache.ini similarity index 100% rename from docker/dev/mtt-php81-nginx/php-opcache.ini rename to docker/dev/mtt-php82-nginx/php-opcache.ini