From 375f72c20f391d70ef15c8df554bb028c4218076 Mon Sep 17 00:00:00 2001 From: Sergey Paramoshkin Date: Tue, 14 Jan 2025 09:52:53 +0300 Subject: [PATCH 1/4] move to fpm --- Dockerfile | 9 +++++---- docker/nginx/default.conf | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 41d2366..caa9e36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ RUN apt update && apt install -y \ libonig-dev \ libxslt1-dev \ acl \ + nginx \ && echo 'alias sf="php bin/console"' >> ~/.bashrc RUN wget -q -O /etc/apt/trusted.gpg.d/lab50.gpg http://packages.lab50.net/lab50.gpg @@ -64,16 +65,16 @@ COPY ./backend /usr/src/signer COPY ./docker/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf -RUN curl curl https://frankenphp.dev/install.sh | sh -RUN mv /usr/src/signer/frankenphp /usr/local/bin/ +# RUN curl curl https://frankenphp.dev/install.sh | sh +# RUN mv /usr/src/signer/frankenphp /usr/local/bin/ ENV COMPOSER_ALLOW_SUPERUSER=1 RUN composer install -RUN service php8.3-fpm start +# RUN service php8.3-fpm start COPY entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] -CMD ["php-fpm8.3", "-F"] +CMD ["php-fpm8.3", "-F", "nginx", "-g 'daemon off'"] EXPOSE 9000 \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 8cf0e9a..221860f 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -1,6 +1,21 @@ server { server_name _; listen *:80; + index index.php index.html index.htm; + root /usr/src/signer/public; - root /application/public; -} + + location ~* \.php$ { + try_files $uri $uri/ /index.php last; + fastcgi_split_path_info (.+?\.php)(/.*)$; + fastcgi_pass localhost:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + location ~* .php/ { + rewrite (.*.php)/ $1 last; + } +} \ No newline at end of file -- 2.40.1 From a83662d4a46ea5a1b146a4a3c789c819ac0a26f2 Mon Sep 17 00:00:00 2001 From: ddadmin Date: Thu, 16 Jan 2025 17:47:39 +0300 Subject: [PATCH 2/4] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index caa9e36..1c5c333 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,7 +64,7 @@ WORKDIR /usr/src/signer/ COPY ./backend /usr/src/signer COPY ./docker/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf - +RUN mkdir -p /run/php # RUN curl curl https://frankenphp.dev/install.sh | sh # RUN mv /usr/src/signer/frankenphp /usr/local/bin/ @@ -75,6 +75,6 @@ RUN composer install COPY entrypoint.sh /entrypoint.sh ENTRYPOINT [ "/entrypoint.sh" ] -CMD ["php-fpm8.3", "-F", "nginx", "-g 'daemon off'"] +# CMD ["php-fpm8.3", "-F", "nginx", "-g 'daemon off'"] EXPOSE 9000 \ No newline at end of file -- 2.40.1 From 9ad05be4255f783fbe9d75fc6359d0ca465241bc Mon Sep 17 00:00:00 2001 From: ddadmin Date: Thu, 16 Jan 2025 17:53:51 +0300 Subject: [PATCH 3/4] Update Dockerfile --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 1c5c333..2f8014c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,6 +64,8 @@ WORKDIR /usr/src/signer/ COPY ./backend /usr/src/signer COPY ./docker/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf +COPY ./docker/php/nginx/default.conf /etc/nginx/sites-enabled/default +COPY ./docker/php/nginx.conf /etc/nginx/nginx.conf RUN mkdir -p /run/php # RUN curl curl https://frankenphp.dev/install.sh | sh # RUN mv /usr/src/signer/frankenphp /usr/local/bin/ -- 2.40.1 From 983c886cc827f1d1cf6922fbc799efd6177056a0 Mon Sep 17 00:00:00 2001 From: Sergey Paramoshkin Date: Thu, 16 Jan 2025 17:57:18 +0300 Subject: [PATCH 4/4] fix files --- Dockerfile | 4 ++-- docker/nginx/nginx.conf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f8014c..6edd99c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,8 +64,8 @@ WORKDIR /usr/src/signer/ COPY ./backend /usr/src/signer COPY ./docker/php/www.conf /etc/php/8.3/fpm/pool.d/www.conf -COPY ./docker/php/nginx/default.conf /etc/nginx/sites-enabled/default -COPY ./docker/php/nginx.conf /etc/nginx/nginx.conf +COPY ./docker/nginx/default.conf /etc/nginx/sites-enabled/default +COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf RUN mkdir -p /run/php # RUN curl curl https://frankenphp.dev/install.sh | sh # RUN mv /usr/src/signer/frankenphp /usr/local/bin/ diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 2c6a3f8..704f46a 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -1,9 +1,10 @@ user www-data; worker_processes 4; +daemon off; pid /run/nginx.pid; events { - worker_connections 2048; + worker_connections 2048; multi_accept on; use epoll; } @@ -34,4 +35,3 @@ http { fastcgi_buffer_size 32k; } -daemon off; -- 2.40.1