UI delivery, stage D: app-ui image on nginx-unprivileged (user nginx, port 8080)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ayurishchevandClaude Sonnet 5.5 committed 2026-10-07 13:31:53 +03:00
1 parent 71ea4c5945
commit 3347fffe8e
4 files changed
+15 -12

No files matched your search

+9 -7
View File
@@ -7,15 +7,17 @@ COPY . .
RUN npm run build
# Stage 2: Serve
# nginx runs as root here: the image entrypoint renders the template into /etc/nginx/conf.d and port 80
# is published by docker-compose. An unprivileged variant would change the port and the image.
FROM nginx:alpine
# nginx runs as the unprivileged user "nginx" (uid 101) and listens on 8080 (OVP_UI_PORT); docker-compose publishes
# it as the host port (OVPMON_HTTP_PORT, default 80). The image entrypoint renders the template into
# /etc/nginx/conf.d. Behind another proxy or Kubernetes: target port 8080.
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY default.conf.template /etc/nginx/templates/default.conf.template
# Validates OVP_CSP_CONNECT_EXTRA before the template is rendered (20-envsubst-on-templates.sh)
COPY check-csp-connect-extra.sh /docker-entrypoint.d/15-check-csp-connect-extra.sh
# Extra connect-src origins of the CSP, separated by spaces (empty: same origin only). envsubst replaces
# only variables that are defined, so the default must exist
ENV OVP_CSP_CONNECT_EXTRA=""
EXPOSE 80
# envsubst replaces only variables that are defined, so the defaults must exist.
# OVP_CSP_CONNECT_EXTRA: extra connect-src origins of the CSP, separated by spaces (empty: same origin only)
ENV OVP_UI_PORT=8080 \
OVP_CSP_CONNECT_EXTRA=""
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
+1 -1
View File
@@ -1,5 +1,5 @@
server {
listen 80;
listen ${OVP_UI_PORT};
server_name localhost;
server_tokens off;