fix(docker): update Dockerfile to Node.js SSR runtime runner entry.mjs
All checks were successful
Production Build & Deploy / build-and-deploy (push) Successful in 1m15s
All checks were successful
Production Build & Deploy / build-and-deploy (push) Successful in 1m15s
This commit is contained in:
24
Dockerfile
24
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"]
|
||||
|
||||
Reference in New Issue
Block a user