работа с контейнерами
This commit is contained in:
@@ -56,6 +56,11 @@ RUN apt-get update && apt-get upgrade -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y nginx php8.3-fpm \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.3
|
||||
|
||||
RUN userdel -r ubuntu
|
||||
@@ -65,7 +70,10 @@ RUN git config --global --add safe.directory /var/www/html
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY php-fpm-pool.conf /etc/php/8.3/fpm/pool.d/www.conf
|
||||
COPY php.ini /etc/php/8.3/cli/conf.d/99-sail.ini
|
||||
COPY php.ini /etc/php/8.3/fpm/conf.d/99-sail.ini
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
EXPOSE 80/tcp
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
user sail;
|
||||
worker_processes auto;
|
||||
pid /run/nginx.pid;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
access_log /dev/stdout;
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
keepalive_timeout 65;
|
||||
client_max_body_size 100m;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
root /var/www/html/public;
|
||||
index index.php;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /healthz {
|
||||
allow 127.0.0.1;
|
||||
deny all;
|
||||
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME /dev/null;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param HTTP_PROXY "";
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_read_timeout 60s;
|
||||
}
|
||||
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
[www]
|
||||
user = sail
|
||||
group = sail
|
||||
|
||||
listen = 127.0.0.1:9000
|
||||
listen.owner = sail
|
||||
listen.group = sail
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 8
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 4
|
||||
pm.max_requests = 500
|
||||
|
||||
request_terminate_timeout = 60s
|
||||
request_slowlog_timeout = 10s
|
||||
slowlog = /proc/self/fd/2
|
||||
|
||||
ping.path = /healthz
|
||||
ping.response = pong
|
||||
|
||||
clear_env = no
|
||||
catch_workers_output = yes
|
||||
decorate_workers_output = no
|
||||
@@ -4,10 +4,29 @@ user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:php]
|
||||
command=%(ENV_SUPERVISOR_PHP_COMMAND)s
|
||||
user=%(ENV_SUPERVISOR_PHP_USER)s
|
||||
environment=LARAVEL_SAIL="1"
|
||||
[program:php-fpm]
|
||||
command=/usr/sbin/php-fpm8.3 --nodaemonize --fpm-config /etc/php/8.3/fpm/php-fpm.conf
|
||||
user=root
|
||||
priority=10
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=2
|
||||
stopasgroup=true
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:nginx]
|
||||
command=/usr/sbin/nginx -g "daemon off;"
|
||||
user=root
|
||||
priority=20
|
||||
autostart=true
|
||||
autorestart=true
|
||||
startsecs=2
|
||||
stopasgroup=true
|
||||
stopsignal=QUIT
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
|
||||
Reference in New Issue
Block a user