Skip to content
Snippets Groups Projects
Commit e6f5c008 authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

Merge branch 'fix/nginx-unprivileged-image' into 'dev'

Fix/nginx unprivileged image

See merge request web-et-numerique/llle_project/backoffice-client!78
parents dc7735c3 02889f65
No related branches found
No related tags found
5 merge requests!96Deploy OpenShift v2,!95MEP fix liens undefined,!91MEP: removed Meilisearch,!79Fix: nginx unprivileged image,!78Fix/nginx unprivileged image
Pipeline #46476 passed
......@@ -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
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
......
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
......
......@@ -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;
}
......
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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment