diff --git a/deploy/Dockerfile.prod b/deploy/Dockerfile.prod index f6a54e43..b6b16306 100644 --- a/deploy/Dockerfile.prod +++ b/deploy/Dockerfile.prod @@ -34,9 +34,8 @@ RUN curl -O http://nginx.org/download/nginx-1.24.0.tar.gz \ ENV PATH="/usr/local/nginx/sbin:$PATH" # Set up Nginx and Supervisor configurations -RUN echo "daemon off;" >> /usr/local/nginx/conf/nginx.conf RUN rm /usr/local/nginx/conf/nginx.conf -ADD ./nginx-app.conf /usr/local/nginx/conf/ +ADD ./nginx-app.conf /usr/local/nginx/conf/nginx.conf ADD ./supervisor-app.conf /etc/supervisor/conf.d/ # Copy Python app files diff --git a/nginx-app.conf b/nginx-app.conf index 4d149a1b..fd037c3a 100644 --- a/nginx-app.conf +++ b/nginx-app.conf @@ -1,27 +1,33 @@ # mysite_nginx.conf -# the upstream component nginx needs to connect to -upstream flask { - server unix:/tmp/app.sock; # for a file socket - # server 127.0.0.1:8001; # for a web port socket (we'll use this first) +events { + worker_connections 1024; } -# configuration of the server -server { - # the port your site will be served on, default_server indicates that this server block - # is the block to use if no blocks match the server_name - listen 80 default_server; +http { + # the upstream component nginx needs to connect to + upstream flask { + server unix:/tmp/app.sock; # for a file socket + # server 127.0.0.1:8001; # for a web port socket (we'll use this first) + } - # the domain name it will serve for - server_name get.replicated.com; # substitute your machine's IP address or FQDN - charset utf-8; + # configuration of the server + server { + # the port your site will be served on, default_server indicates that this server block + # is the block to use if no blocks match the server_name + listen 80 default_server; - # max upload size - client_max_body_size 75M; # adjust to taste + # the domain name it will serve for + server_name get.replicated.com; # substitute your machine's IP address or FQDN + charset utf-8; - # Finally, send all non-media requests to the Flask server. - location / { - uwsgi_pass flask; - include /home/docker/code/uwsgi_params; # the uwsgi_params file you installed - } + # max upload size + client_max_body_size 75M; # adjust to taste + + # Finally, send all non-media requests to the Flask server. + location / { + uwsgi_pass flask; + include /home/docker/code/uwsgi_params; # the uwsgi_params file you installed + } + } } diff --git a/supervisor-app.conf b/supervisor-app.conf index cdd76172..3546a06d 100644 --- a/supervisor-app.conf +++ b/supervisor-app.conf @@ -6,4 +6,8 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 [program:nginx-app] -command = /usr/sbin/nginx +command = /usr/local/nginx/sbin/nginx -g "daemon off;" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0