From 884d477e341c0f599181bf18ed15719795e81b8f Mon Sep 17 00:00:00 2001 From: Scott Cathcart Date: Wed, 20 Nov 2024 12:45:40 -0500 Subject: [PATCH] update nginx settings for less workers --- Dockerfile | 1 + nginx/nginx.conf | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 nginx/nginx.conf diff --git a/Dockerfile b/Dockerfile index 221d9c3..e88a51e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN npm run build # Step 2: Serve the app using NGINX FROM nginxinc/nginx-unprivileged:mainline COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf +COPY ./nginx/nginx.conf /etc/nginx/nginx.conf COPY --from=build /usr/src/app/dist /usr/share/nginx/html EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..80052ba --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,36 @@ +worker_processes 4; + +error_log /var/log/nginx/error.log notice; +pid /tmp/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + proxy_temp_path /tmp/proxy_temp; + client_body_temp_path /tmp/client_temp; + fastcgi_temp_path /tmp/fastcgi_temp; + uwsgi_temp_path /tmp/uwsgi_temp; + scgi_temp_path /tmp/scgi_temp; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} \ No newline at end of file