Files
ndsolutionswebsite/Dockerfile
DanielS ee239978f3
All checks were successful
Production Build & Deploy / build-and-deploy (push) Successful in 26s
fix: disable port in redirect for Nginx in Docker container
2026-07-07 00:51:53 +02:00

22 lines
515 B
Docker

# Build-Phase
FROM node:20-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install --legacy-peer-deps
COPY . .
RUN npm run build
# Production-Phase
FROM nginx:1.25
# Eigene Nginx-Konfiguration kopieren
COPY default.conf /etc/nginx/conf.d/default.conf
# Nginx konfigurieren für non-root Port 8080
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid /var/cache/nginx /var/log/nginx /etc/nginx/conf.d
USER nginx
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 8080