From e41603f267676e8aadff387b3998408f59c23dcc Mon Sep 17 00:00:00 2001 From: Daniel Edgar Date: Sat, 5 Aug 2023 14:20:10 -0700 Subject: [PATCH] switch to the unprivileged nginx container for spa web server --- docker-compose.yml | 4 ++-- spa/Dockerfile | 4 ++-- spa/nginx.conf | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fe03e5ad..02820b8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ services: VITE_APP_GLOBAL_BACKGROUND_COLOR: "#FFF" container_name: spa ports: - - "8081:80" + - "8081:8080" links: - api restart: unless-stopped @@ -48,7 +48,7 @@ services: VITE_APP_GLOBAL_BACKGROUND_COLOR: "#000" container_name: spa-dark ports: - - "8082:80" + - "8082:8080" links: - api restart: unless-stopped diff --git a/spa/Dockerfile b/spa/Dockerfile index c0882ff9..52d4da1c 100644 --- a/spa/Dockerfile +++ b/spa/Dockerfile @@ -19,11 +19,11 @@ ENV VITE_APP_GLOBAL_COLOR $VITE_APP_GLOBAL_COLOR RUN npm run build # --------- Release --------- -FROM nginx:stable-alpine as release +FROM nginxinc/nginx-unprivileged:stable-alpine as release COPY --from=builder /app/dist /usr/share/nginx/html COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 +EXPOSE 8080 CMD ["nginx", "-g", "daemon off;"] diff --git a/spa/nginx.conf b/spa/nginx.conf index a3e64c87..9ab21608 100644 --- a/spa/nginx.conf +++ b/spa/nginx.conf @@ -1,7 +1,6 @@ -user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; +pid /tmp/nginx.pid; events { worker_connections 1024; } @@ -16,7 +15,7 @@ http { sendfile on; keepalive_timeout 65; server { - listen 80; + listen 8080; server_name _ default_server; index index.html; location / {