Skip to content

fix: dockerfile: use unprivileged nginx #1657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CI/e2e/docker-compose.e2e.yaml
Original file line number Diff line number Diff line change
@@ -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:
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -8,8 +8,11 @@ RUN npm ci
COPY . /frontend/
RUN npx ng build

FROM nginx:1.28-alpine
FROM docker.io/nginxinc/nginx-unprivileged:1.26.3
USER root
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /frontend/dist/browser/ /usr/share/nginx/html/
COPY scripts/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
USER 101
COPY --from=builder /frontend/dist/ /usr/share/nginx/html/
EXPOSE 8080
7 changes: 3 additions & 4 deletions scripts/nginx.conf
Original file line number Diff line number Diff line change
@@ -2,10 +2,9 @@
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
pid /tmp/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
@@ -31,8 +30,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;

Loading