Skip to content

Commit

Permalink
Merge pull request #75 from kool-dev/tune_nginx_processes
Browse files Browse the repository at this point in the history
Tune nginx processes
  • Loading branch information
dbpolito authored Jan 31, 2023
2 parents e18825d + 6357723 commit 845daee
Show file tree
Hide file tree
Showing 45 changed files with 122 additions and 30 deletions.
7 changes: 5 additions & 2 deletions 7.1-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.1-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.1-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.1-nginx/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.1-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.1/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.2-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.2-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.2-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.2-nginx/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.2-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.2/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.3-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.3-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.3-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.3-nginx/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.3-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.3/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.4-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.4-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 7.4-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 7.4-nginx/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.4-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 7.4/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 8.0-nginx-prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 8.0-nginx-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
7 changes: 5 additions & 2 deletions 8.0-nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
NGINX_FASTCGI_READ_TIMEOUT=60s \
NGINX_FASTCGI_BUFFERS='8 8k' \
NGINX_FASTCGI_BUFFER_SIZE='16k'
NGINX_FASTCGI_BUFFER_SIZE='16k' \
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=true

RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
&& chmod +x /usr/local/bin/supervisord \
Expand All @@ -28,7 +29,9 @@ RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/s
&& mv server-configs-nginx-*/nginx.conf /etc/nginx/nginx.conf \
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
&& mv server-configs-nginx-*/mime.types /etc/nginx/mime.types \
&& rm -rf server-configs-nginx-*
&& rm -rf server-configs-nginx-* \
&& curl -L https://raw.githubusercontent.com/nginxinc/docker-nginx/master/entrypoint/30-tune-worker-processes.sh -o /kool/30-tune-worker-processes.sh \
&& chmod +x /kool/30-tune-worker-processes.sh

COPY supervisor.conf /kool/supervisor.conf
COPY default.tmpl /kool/default.tmpl
Expand Down
2 changes: 2 additions & 0 deletions 8.0-nginx/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf -template /kool/default.tmpl:/etc/nginx/conf.d/default.conf

/kool/30-tune-worker-processes.sh

# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 8.0-prod/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
1 change: 1 addition & 0 deletions 8.0/entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fi

dockerize -template /kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini -template /kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf


# Run entrypoint if provided
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
bash $ENTRYPOINT
Expand Down
Loading

0 comments on commit 845daee

Please sign in to comment.