Skip to content

Commit

Permalink
Dockerfile: use unprivileged nginx
Browse files Browse the repository at this point in the history
This allows running this container w/ arbitrary uid support
  • Loading branch information
cfelder committed Nov 15, 2024
1 parent 578a106 commit ef7cffa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CI/e2e/docker-compose.e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,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:
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions scripts/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ef7cffa

Please sign in to comment.