Merged in feature/404multidev (pull request #28)
Feature/404multidev * Fix socket location * Fix socket location * Fix socket location * Fix socket location * To fix sock file issue * fix issues with clear_env = no * Ondemand fpm and deploy update * Merged develop into feature/404multidev * Merged develop into feature/404multidev * Add config map for www pool and supd Approved-by: Rachit Bhargava
This commit is contained in:
committed by
Rachit Bhargava
parent
26436a6c6d
commit
f7484692e6
@@ -1,10 +1,10 @@
|
|||||||
FROM wyveo/nginx-php-fpm:php74
|
FROM wyveo/nginx-php-fpm:php74
|
||||||
RUN mkdir -p /var/lib/nginx/cache /usr/share/nginx/subdomain; cd /usr/share/nginx/subdomain ; mkdir www
|
RUN mkdir -p /var/lib/nginx/cache /usr/share/nginx/subdomain;cd /usr/share/nginx/subdomain;mkdir www
|
||||||
COPY wp/ /usr/share/nginx/subdomain/www
|
COPY wp/ /usr/share/nginx/subdomain/www
|
||||||
COPY ngx_http_cache_purge_module.so /usr/lib/nginx/modules/
|
COPY ngx_http_cache_purge_module.so /usr/lib/nginx/modules/
|
||||||
RUN sed -i 's/;pm.status_path/pm.status_path/g' /etc/php/7.4/fpm/pool.d/www.conf
|
RUN sed -i 's/;pm.status_path/pm.status_path/g' /etc/php/7.4/fpm/pool.d/www.conf
|
||||||
RUN sed -i -e '1iload_module modules/ngx_http_cache_purge_module.so;\' /etc/nginx/nginx.conf
|
RUN sed -i -e '1iload_module modules/ngx_http_cache_purge_module.so;\' /etc/nginx/nginx.conf
|
||||||
RUN rm /etc/php/7.4/fpm/php.ini
|
RUN rm /etc/php/7.4/fpm/php.ini
|
||||||
RUN rm /etc/php/7.4/cli/php.ini
|
RUN rm /etc/php/7.4/cli/php.ini
|
||||||
COPY php.ini /etc/php/7.4/cli/php.ini
|
COPY php.ini /etc/php/7.4/cli/php.ini
|
||||||
COPY php.ini /etc/php/7.4/fpm/php.ini
|
COPY php.ini /etc/php/7.4/fpm/php.ini
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- /root/redinessprobe-wp.sh
|
- /root/redinessprobe-wp.sh
|
||||||
initialDelaySeconds: 90
|
initialDelaySeconds: 90
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
failureThreshold: 5
|
failureThreshold: 5
|
||||||
successThreshold: 1
|
successThreshold: 1
|
||||||
@@ -84,7 +84,7 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 1000m
|
cpu: 1000m
|
||||||
memory: 2048Mi
|
memory: 5120Mi
|
||||||
requests:
|
requests:
|
||||||
cpu: 500m
|
cpu: 500m
|
||||||
memory: 1024Mi
|
memory: 1024Mi
|
||||||
@@ -117,6 +117,11 @@ spec:
|
|||||||
name: empty-dir
|
name: empty-dir
|
||||||
- mountPath: /usr/share/nginx/subdomain/dev05/wp-content/wflogs
|
- mountPath: /usr/share/nginx/subdomain/dev05/wp-content/wflogs
|
||||||
name: empty-dir
|
name: empty-dir
|
||||||
|
- mountPath: /etc/supervisord.conf
|
||||||
|
subPath: supervisord.conf
|
||||||
|
name: supervisord-conf
|
||||||
|
- mountPath: /etc/php/7.4/fpm/pool.d/
|
||||||
|
name: fpm-pool-www-conf
|
||||||
dnsPolicy: ClusterFirst
|
dnsPolicy: ClusterFirst
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
- name: regcred
|
- name: regcred
|
||||||
@@ -150,3 +155,11 @@ spec:
|
|||||||
name: medicalalert-web-default-conf-cm
|
name: medicalalert-web-default-conf-cm
|
||||||
- emptyDir: {}
|
- emptyDir: {}
|
||||||
name: empty-dir
|
name: empty-dir
|
||||||
|
- name: supervisord-conf
|
||||||
|
configMap:
|
||||||
|
defaultMode: 420
|
||||||
|
name: supervisord-cm
|
||||||
|
- name: fpm-pool-www-conf
|
||||||
|
configMap:
|
||||||
|
defaultMode: 420
|
||||||
|
name: fpm-pool-www-conf-cm
|
||||||
|
|||||||
124
build/dev/fpm-pool-www-conf-cm.yaml
Normal file
124
build/dev/fpm-pool-www-conf-cm.yaml
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: fpm-pool-www-conf-cm
|
||||||
|
namespace: medicalalert-web
|
||||||
|
labels:
|
||||||
|
app: medicalalert-web
|
||||||
|
data:
|
||||||
|
www.conf: |
|
||||||
|
[www]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-www.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
[dev01]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-dev01.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
[dev02]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-dev02.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
[dev03]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-dev03.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
[dev04]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-dev04.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
[dev05]
|
||||||
|
user = nginx
|
||||||
|
group = nginx
|
||||||
|
listen = /run/php/php7.4-fpm-dev05.sock
|
||||||
|
listen.owner = nginx
|
||||||
|
listen.group = nginx
|
||||||
|
pm = ondemand
|
||||||
|
pm.max_children = 100
|
||||||
|
pm.process_idle_timeout = 12s
|
||||||
|
pm.max_requests = 300
|
||||||
|
pm.status_path = /status
|
||||||
|
catch_workers_output = yes
|
||||||
|
clear_env = no
|
||||||
|
access.log = /var/log/fpm-php.access.log
|
||||||
|
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||||
|
slowlog = /var/log/fpm-php.log.slow
|
||||||
|
request_slowlog_timeout = 12s
|
||||||
|
request_terminate_timeout_track_finished = yes
|
||||||
|
|
||||||
|
|
||||||
61
build/dev/supervisord-cm.yaml
Normal file
61
build/dev/supervisord-cm.yaml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: supervisord-cm
|
||||||
|
namespace: medicalalert-web
|
||||||
|
labels:
|
||||||
|
app: medicalalert-web
|
||||||
|
data:
|
||||||
|
supervisord.conf: |
|
||||||
|
[unix_http_server]
|
||||||
|
file=/tmp/supervisor.sock ; (the path to the socket file)
|
||||||
|
username=nobody
|
||||||
|
password=nobody
|
||||||
|
|
||||||
|
[supervisord]
|
||||||
|
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
||||||
|
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
|
||||||
|
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
|
||||||
|
loglevel=trace ; (log level;default info; others: debug,warn,trace)
|
||||||
|
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
||||||
|
nodaemon=false ; (start in foreground if true;default false)
|
||||||
|
minfds=1024 ; (min. avail startup file descriptors;default 1024)
|
||||||
|
minprocs=200 ; (min. avail process descriptors;default 200)
|
||||||
|
user=root ; (default is current user, required if root)
|
||||||
|
|
||||||
|
; the below section must remain in the config file for RPC
|
||||||
|
; (supervisorctl/web interface) to work, additional interfaces may be
|
||||||
|
; added by defining them in separate rpcinterface: sections
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[supervisorctl]
|
||||||
|
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
|
||||||
|
|
||||||
|
[program:php-fpm7]
|
||||||
|
command=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config=/etc/php/7.4/fpm/pool.d/www.conf
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=5
|
||||||
|
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;"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=10
|
||||||
|
stdout_events_enabled=true
|
||||||
|
stderr_events_enabled=true
|
||||||
|
stdout_logfile=/dev/stdout
|
||||||
|
stdout_logfile_maxbytes=0
|
||||||
|
stderr_logfile=/dev/stderr
|
||||||
|
stderr_logfile_maxbytes=0
|
||||||
|
|
||||||
|
[eventlistener:stdout]
|
||||||
|
command = supervisor_stdout
|
||||||
|
buffer_size = 100
|
||||||
|
events = PROCESS_LOG
|
||||||
|
result_handler = supervisor_stdout:event_handler
|
||||||
@@ -162,7 +162,7 @@ data:
|
|||||||
}
|
}
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
|
||||||
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
fastcgi_pass unix:/run/php/php7.4-fpm-$subdomain.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SUBDOMAIN $subdomain; # $_SERVER["SUBDOMAIN"]
|
fastcgi_param SUBDOMAIN $subdomain; # $_SERVER["SUBDOMAIN"]
|
||||||
@@ -284,7 +284,7 @@ data:
|
|||||||
}
|
}
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
|
||||||
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
fastcgi_pass unix:/run/php/php7.4-fpm-www.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
@@ -321,7 +321,7 @@ data:
|
|||||||
deny all;
|
deny all;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
||||||
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
|
fastcgi_pass unix:/run/php/php7.4-fpm-www.sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user