From f3ce1e16b698fe2374804e27777f30fbce73db6c Mon Sep 17 00:00:00 2001
From: Antoine  Millet <1337-anmillet@users.noreply.gitlab.pasteur.fr>
Date: Thu, 10 Dec 2020 17:29:12 +0100
Subject: [PATCH] Also fixed run as non root for "prod" nginx static server

---
 nginx/prod/Dockerfile |  4 ++--
 nginx/prod/nginx.conf | 10 +++++++++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/nginx/prod/Dockerfile b/nginx/prod/Dockerfile
index aab63dcb..8fae003d 100644
--- a/nginx/prod/Dockerfile
+++ b/nginx/prod/Dockerfile
@@ -1,6 +1,6 @@
-FROM nginx:1.17.6-alpine
+FROM nginxinc/nginx-unprivileged:1.17.6-alpine
 COPY nginx.conf /etc/nginx/nginx.conf
-EXPOSE 80
+EXPOSE 8080
 CMD ["nginx", "-g", "daemon off;"]
 
 
diff --git a/nginx/prod/nginx.conf b/nginx/prod/nginx.conf
index 66716872..f6e2f378 100644
--- a/nginx/prod/nginx.conf
+++ b/nginx/prod/nginx.conf
@@ -1,13 +1,21 @@
+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;
   client_max_body_size 100m;
 
   server {
-    listen 80;
+    listen 8080;
     root  /usr/src/app/;
 
     location /static/ {
-- 
GitLab