diff --git a/Dockerfile b/Dockerfile index 05cf7fee..25cc5fe7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ 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 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 -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 COPY php.ini /etc/php/7.4/cli/php.ini COPY php.ini /etc/php/7.4/fpm/php.ini diff --git a/build/dev/deployment.tpl b/build/dev/deployment.tpl index 13c76616..fc0ba963 100755 --- a/build/dev/deployment.tpl +++ b/build/dev/deployment.tpl @@ -58,7 +58,7 @@ spec: command: - /root/redinessprobe-wp.sh initialDelaySeconds: 90 - periodSeconds: 30 + periodSeconds: 10 timeoutSeconds: 10 failureThreshold: 5 successThreshold: 1 @@ -84,7 +84,7 @@ spec: resources: limits: cpu: 1000m - memory: 5120Mi + memory: 2048Mi requests: cpu: 500m memory: 1024Mi @@ -117,11 +117,6 @@ spec: name: empty-dir - mountPath: /usr/share/nginx/subdomain/dev05/wp-content/wflogs 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 imagePullSecrets: - name: regcred @@ -155,11 +150,3 @@ spec: name: medicalalert-web-default-conf-cm - emptyDir: {} 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 diff --git a/build/dev/fpm-pool-www-conf-cm.yaml b/build/dev/fpm-pool-www-conf-cm.yaml deleted file mode 100644 index 3ba21c69..00000000 --- a/build/dev/fpm-pool-www-conf-cm.yaml +++ /dev/null @@ -1,124 +0,0 @@ -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 - - \ No newline at end of file diff --git a/build/dev/supervisord-cm.yaml b/build/dev/supervisord-cm.yaml deleted file mode 100644 index b1e0566b..00000000 --- a/build/dev/supervisord-cm.yaml +++ /dev/null @@ -1,61 +0,0 @@ -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 \ No newline at end of file diff --git a/build/dev/web-default-conf-cm.yaml b/build/dev/web-default-conf-cm.yaml index 07498d5c..26c43976 100644 --- a/build/dev/web-default-conf-cm.yaml +++ b/build/dev/web-default-conf-cm.yaml @@ -162,7 +162,7 @@ data: } fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/run/php/php7.4-fpm-$subdomain.sock; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SUBDOMAIN $subdomain; # $_SERVER["SUBDOMAIN"] @@ -284,7 +284,7 @@ data: } fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:/run/php/php7.4-fpm-www.sock; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; @@ -321,7 +321,7 @@ data: deny all; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; - fastcgi_pass unix:/run/php/php7.4-fpm-www.sock; + fastcgi_pass unix:/run/php/php7.4-fpm.sock; } }