From 2fd91038b59946b0f79001578d816e2f473e7989 Mon Sep 17 00:00:00 2001 From: Christian Felder Date: Wed, 6 Nov 2024 16:53:37 -0500 Subject: [PATCH] Dockerfile: use unprivileged nginx This allows running this container w/ arbitrary uid support --- CI/e2e/docker-compose.e2e.yaml | 2 +- Dockerfile | 6 ++---- scripts/nginx.conf | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CI/e2e/docker-compose.e2e.yaml b/CI/e2e/docker-compose.e2e.yaml index c80cfd218..88bc220b4 100644 --- a/CI/e2e/docker-compose.e2e.yaml +++ b/CI/e2e/docker-compose.e2e.yaml @@ -48,7 +48,7 @@ services: build: context: . ports: - - 4200:80 + - 4200:8080 volumes: - "./CI/e2e/frontend.config.e2e.json:/usr/share/nginx/html/assets/config.json" depends_on: diff --git a/Dockerfile b/Dockerfile index 5fd4c5dc7..ec8e2db2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,6 @@ RUN npm ci COPY . /frontend/ RUN npx ng build -FROM nginx:1.25-alpine -RUN rm -rf /usr/share/nginx/html/* +FROM nginxinc/nginx-unprivileged COPY --from=builder /frontend/dist/ /usr/share/nginx/html/ -COPY scripts/nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 +EXPOSE 8080 diff --git a/scripts/nginx.conf b/scripts/nginx.conf index 525bde35c..a52262e1f 100644 --- a/scripts/nginx.conf +++ b/scripts/nginx.conf @@ -31,8 +31,8 @@ http { default_type application/octet-stream; server { - listen 80 default_server; - listen [::]:80 default_server; + listen 8080 default_server; + listen [::]:8080 default_server; server_name _; root /usr/share/nginx/html;