diff --git a/Dockerfile b/Dockerfile index 2e64a3212dc59477697716d26a5ecc7026622613..9c786b8400cc42e2597f2e9bdee520a55747ad8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,9 @@ COPY ./ /app/ RUN yarn build # Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx -FROM nginx:1.16 +FROM nginxinc/nginx-unprivileged:1.23 COPY --from=build-stage /app/build/ /usr/share/nginx/html COPY ./nginx/nginx.conf /etc/nginx/nginx.conf COPY ./nginx/site.prod.conf /etc/nginx/conf.d/default.conf -EXPOSE 80 +EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-compose.local.yml b/docker-compose.local.yml index dff4078204c8eef5e4f50ba901f3e9df4de58e8d..b8fef645296c3b28c3800f4247cc4aa172e4940a 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -1,7 +1,7 @@ version: '3.7' services: nginx: - image: nginx:1.16 + image: nginxinc/nginx-unprivileged:1.23 volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/site.conf:/etc/nginx/conf.d/default.conf diff --git a/nginx/nginx.conf b/nginx/nginx.conf index af0a4a69be83e562124788fe33855439154811aa..1ca6ae710408f9a11d781ac8a074c5eede6b60f2 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,6 +1,6 @@ worker_processes auto; error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; +pid /tmp/nginx.pid; events { worker_connections 1024; diff --git a/nginx/site.conf b/nginx/site.conf index 8304b5b033888634c53fb8b4489b9057cc955bfe..cf2467c3dcdce3caffa5e92e38aec7fe3fbe7424 100644 --- a/nginx/site.conf +++ b/nginx/site.conf @@ -24,6 +24,9 @@ server { location /swagger { proxy_pass https://backend:1443/swagger; } + location /imageNames { + proxy_pass https://backend:1443/api/admin/imageNames; + } location /assets { proxy_pass https://backend:1443/assets; } diff --git a/nginx/site.prod.conf b/nginx/site.prod.conf index e9fdd62d7b729d162e9ef5cf96c2c57a274018de..bd895ca51feded517ba578a9bff24b86f4bca64f 100644 --- a/nginx/site.prod.conf +++ b/nginx/site.prod.conf @@ -1,13 +1,12 @@ server { listen 8080; - server_name ecolyo-agent.self-data.alpha.grandlyon.com; + server_name ecolyo-agent.apps.grandlyon.com; location / { root /usr/share/nginx/html; index index.html index.htm; try_files $uri $uri/ /index.html =404; } - location /api { proxy_pass https://backend:1443/api; } @@ -26,13 +25,8 @@ server { location /imageNames { proxy_pass https://backend:1443/api/admin/imageNames; } - - location ~ ^/assets/(.+\.(?:gif|jpe?g|svg))$ { - alias /usr/share/nginx/html/lib/$1; - gzip_static on; - expires max; - add_header Cache-Control public; + location /assets { + proxy_pass https://backend:1443/assets; } - }