File tree Expand file tree Collapse file tree 10 files changed +50
-7
lines changed Expand file tree Collapse file tree 10 files changed +50
-7
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ ENV UWSGI_INI /app/uwsgi.ini
170170ENV NGINX_MAX_UPLOAD 1m
171171ENV NGINX_MAX_UPLOAD 0
172172
173+ # By default, Nginx will run a single worker process, setting it to auto
174+ # will create a worker for each CPU core
175+ ENV NGINX_WORKER_PROCESSES 1
176+
173177# By default, Nginx listens on port 80.
174178# To modify this, change LISTEN_PORT environment variable.
175179# (in a Dockerfile or with an option for `docker run`)
Original file line number Diff line number Diff line change @@ -6,14 +6,18 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
66# Generate Nginx config for maximum upload file size
77echo " client_max_body_size $USE_NGINX_MAX_UPLOAD ;" > /etc/nginx/conf.d/upload.conf
88
9- # Get the listen port for Nginx, default to 80
10- USE_LISTEN_PORT=${LISTEN_PORT:- 80}
11-
129# Explicitly add installed Python packages and uWSGI Python packages to PYTHONPATH
1310# Otherwise uWSGI can't import Flask
1411export PYTHONPATH=$PYTHONPATH :/usr/local/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages
1512
16- # Modify Nignx config for listen port
13+ # Get the number of workers for Nginx, default to 1
14+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:- 1}
15+ # Modify the number of worker processes in Nginx config
16+ sed -i " /worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES} ;" /etc/nginx/nginx.conf
17+
18+ # Get the listen port for Nginx, default to 80
19+ USE_LISTEN_PORT=${LISTEN_PORT:- 80}
20+ # Modify Nginx config for listen port
1721if ! grep -q " listen ${USE_LISTEN_PORT} ;" /etc/nginx/conf.d/nginx.conf ; then
1822 sed -i -e " /server {/a\ listen ${USE_LISTEN_PORT} ;" /etc/nginx/conf.d/nginx.conf
1923fi
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ ENV UWSGI_INI /app/uwsgi.ini
4141# ENV NGINX_MAX_UPLOAD 1m
4242ENV NGINX_MAX_UPLOAD 0
4343
44+ # By default, Nginx will run a single worker process, setting it to auto
45+ # will create a worker for each CPU core
46+ ENV NGINX_WORKER_PROCESSES 1
47+
4448# By default, Nginx listens on port 80.
4549# To modify this, change LISTEN_PORT environment variable.
4650# (in a Dockerfile or with an option for `docker run`)
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
66# Generate Nginx config for maximum upload file size
77echo " client_max_body_size $USE_NGINX_MAX_UPLOAD ;" > /etc/nginx/conf.d/upload.conf
88
9+ # Get the number of workers for Nginx, default to 1
10+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:- 1}
11+ # Modify the number of worker processes in Nginx config
12+ sed -i " /worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES} ;" /etc/nginx/nginx.conf
13+
914# Get the listen port for Nginx, default to 80
1015USE_LISTEN_PORT=${LISTEN_PORT:- 80}
1116# Modify Nignx config for listen port
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ ENV UWSGI_INI /app/uwsgi.ini
4141# ENV NGINX_MAX_UPLOAD 1m
4242ENV NGINX_MAX_UPLOAD 0
4343
44+ # By default, Nginx will run a single worker process, setting it to auto
45+ # will create a worker for each CPU core
46+ ENV NGINX_WORKER_PROCESSES 1
47+
4448# By default, Nginx listens on port 80.
4549# To modify this, change LISTEN_PORT environment variable.
4650# (in a Dockerfile or with an option for `docker run`)
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
66# Generate Nginx config for maximum upload file size
77echo " client_max_body_size $USE_NGINX_MAX_UPLOAD ;" > /etc/nginx/conf.d/upload.conf
88
9+ # Get the number of workers for Nginx, default to 1
10+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:- 1}
11+ # Modify the number of worker processes in Nginx config
12+ sed -i " /worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES} ;" /etc/nginx/nginx.conf
13+
914# Get the listen port for Nginx, default to 80
1015USE_LISTEN_PORT=${LISTEN_PORT:- 80}
1116# Modify Nignx config for listen port
Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ ENV UWSGI_INI /app/uwsgi.ini
170170ENV NGINX_MAX_UPLOAD 1m
171171ENV NGINX_MAX_UPLOAD 0
172172
173+ # By default, Nginx will run a single worker process, setting it to auto
174+ # will create a worker for each CPU core
175+ ENV NGINX_WORKER_PROCESSES 1
176+
173177# By default, Nginx listens on port 80.
174178# To modify this, change LISTEN_PORT environment variable.
175179# (in a Dockerfile or with an option for `docker run`)
Original file line number Diff line number Diff line change @@ -6,13 +6,17 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
66# Generate Nginx config for maximum upload file size
77echo " client_max_body_size $USE_NGINX_MAX_UPLOAD ;" > /etc/nginx/conf.d/upload.conf
88
9- # Get the listen port for Nginx, default to 80
10- USE_LISTEN_PORT=${LISTEN_PORT:- 80}
11-
129# Explicitly add installed Python packages and uWSGI Python packages to PYTHONPATH
1310# Otherwise uWSGI can't import Flask
1411export PYTHONPATH=$PYTHONPATH :/usr/local/lib/python3.6/site-packages:/usr/lib/python3.6/site-packages
1512
13+ # Get the number of workers for Nginx, default to 1
14+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:- 1}
15+ # Modify the number of worker processes in Nginx config
16+ sed -i " /worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES} ;" /etc/nginx/nginx.conf
17+
18+ # Get the listen port for Nginx, default to 80
19+ USE_LISTEN_PORT=${LISTEN_PORT:- 80}
1620# Modify Nignx config for listen port
1721if ! grep -q " listen ${USE_LISTEN_PORT} ;" /etc/nginx/conf.d/nginx.conf ; then
1822 sed -i -e " /server {/a\ listen ${USE_LISTEN_PORT} ;" /etc/nginx/conf.d/nginx.conf
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ ENV UWSGI_INI /app/uwsgi.ini
123123# ENV NGINX_MAX_UPLOAD 1m
124124ENV NGINX_MAX_UPLOAD 0
125125
126+ # By default, Nginx will run a single worker process, setting it to auto
127+ # will create a worker for each CPU core
128+ ENV NGINX_WORKER_PROCESSES 1
129+
126130# By default, Nginx listens on port 80.
127131# To modify this, change LISTEN_PORT environment variable.
128132# (in a Dockerfile or with an option for `docker run`)
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ USE_NGINX_MAX_UPLOAD=${NGINX_MAX_UPLOAD:-0}
66# Generate Nginx config for maximum upload file size
77echo " client_max_body_size $USE_NGINX_MAX_UPLOAD ;" > /etc/nginx/conf.d/upload.conf
88
9+ # Get the number of workers for Nginx, default to 1
10+ USE_NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:- 1}
11+ # Modify the number of worker processes in Nginx config
12+ sed -i " /worker_processes\s/c\worker_processes ${USE_NGINX_WORKER_PROCESSES} ;" /etc/nginx/nginx.conf
13+
914# Get the listen port for Nginx, default to 80
1015USE_LISTEN_PORT=${LISTEN_PORT:- 80}
1116# Modify Nignx config for listen port
You can’t perform that action at this time.
0 commit comments