diff --git a/Dockerfile b/Dockerfile index 3090715..5ec6356 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,20 @@ RUN npm install --legacy-peer-deps COPY . . RUN npm run build -# Production-Phase -FROM nginx:1.25 +# Production-Phase (Node SSR Runner) +FROM node:20-slim AS runner +WORKDIR /app -# Eigene Nginx-Konfiguration kopieren -COPY default.conf /etc/nginx/conf.d/default.conf +ENV NODE_ENV=production +ENV HOST=0.0.0.0 +ENV PORT=4321 +ENV DATA_DIR=/app/data -# 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 +COPY --from=builder /app/package*.json ./ +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/data_template ./data_template -USER nginx -COPY --from=builder /app/dist /usr/share/nginx/html -EXPOSE 8080 +EXPOSE 4321 + +CMD ["node", "./dist/server/entry.mjs"]