diff --git a/python2.7-alpine3.7/entrypoint.sh b/python2.7-alpine3.7/entrypoint.sh index 610bd8bc..036f3664 100644 --- a/python2.7-alpine3.7/entrypoint.sh +++ b/python2.7-alpine3.7/entrypoint.sh @@ -5,6 +5,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0} # Generate Nginx config for maximum upload file size echo "client_max_body_size $USE_NGINX_MAX_UPLOAD;" > /etc/nginx/conf.d/upload.conf +# Get the number of workers for Nginx, default to 1 +USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} +# Modify the number of worker processes in Nginx config +sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf + # Get the URL for static files from the environment variable USE_STATIC_URL=${STATIC_URL:-'/static'} # Get the absolute path of the static files from the environment variable diff --git a/python2.7/entrypoint.sh b/python2.7/entrypoint.sh index ddd36c72..6f041e31 100644 --- a/python2.7/entrypoint.sh +++ b/python2.7/entrypoint.sh @@ -5,6 +5,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0} # Generate Nginx config for maximum upload file size echo "client_max_body_size $USE_NGINX_MAX_UPLOAD;" > /etc/nginx/conf.d/upload.conf +# Get the number of workers for Nginx, default to 1 +USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} +# Modify the number of worker processes in Nginx config +sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf + # Get the URL for static files from the environment variable USE_STATIC_URL=${STATIC_URL:-'/static'} # Get the absolute path of the static files from the environment variable diff --git a/python3.5/entrypoint.sh b/python3.5/entrypoint.sh index ddd36c72..6f041e31 100644 --- a/python3.5/entrypoint.sh +++ b/python3.5/entrypoint.sh @@ -5,6 +5,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0} # Generate Nginx config for maximum upload file size echo "client_max_body_size $USE_NGINX_MAX_UPLOAD;" > /etc/nginx/conf.d/upload.conf +# Get the number of workers for Nginx, default to 1 +USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} +# Modify the number of worker processes in Nginx config +sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf + # Get the URL for static files from the environment variable USE_STATIC_URL=${STATIC_URL:-'/static'} # Get the absolute path of the static files from the environment variable diff --git a/python3.6-alpine3.7/entrypoint.sh b/python3.6-alpine3.7/entrypoint.sh index 4d1af405..d26995fb 100644 --- a/python3.6-alpine3.7/entrypoint.sh +++ b/python3.6-alpine3.7/entrypoint.sh @@ -5,6 +5,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0} # Generate Nginx config for maximum upload file size echo "client_max_body_size $USE_NGINX_MAX_UPLOAD;" > /etc/nginx/conf.d/upload.conf +# Get the number of workers for Nginx, default to 1 +USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} +# Modify the number of worker processes in Nginx config +sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf + # Get the URL for static files from the environment variable USE_STATIC_URL=${STATIC_URL:-'/static'} # Get the absolute path of the static files from the environment variable diff --git a/python3.6/entrypoint.sh b/python3.6/entrypoint.sh index ddd36c72..6f041e31 100644 --- a/python3.6/entrypoint.sh +++ b/python3.6/entrypoint.sh @@ -5,6 +5,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0} # Generate Nginx config for maximum upload file size echo "client_max_body_size $USE_NGINX_MAX_UPLOAD;" > /etc/nginx/conf.d/upload.conf +# Get the number of workers for Nginx, default to 1 +USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} +# Modify the number of worker processes in Nginx config +sed -i "/worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES};" /etc/nginx/nginx.conf + # Get the URL for static files from the environment variable USE_STATIC_URL=${STATIC_URL:-'/static'} # Get the absolute path of the static files from the environment variable