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 . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Production-Phase
|
# Production-Phase (Node SSR Runner)
|
||||||
FROM nginx:1.25
|
FROM node:20-slim AS runner
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
# Eigene Nginx-Konfiguration kopieren
|
ENV NODE_ENV=production
|
||||||
COPY default.conf /etc/nginx/conf.d/default.conf
|
ENV HOST=0.0.0.0
|
||||||
|
ENV PORT=4321
|
||||||
|
ENV DATA_DIR=/app/data
|
||||||
|
|
||||||
# Nginx konfigurieren für non-root Port 8080
|
COPY --from=builder /app/package*.json ./
|
||||||
RUN touch /var/run/nginx.pid && \
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
chown -R nginx:nginx /var/run/nginx.pid /var/cache/nginx /var/log/nginx /etc/nginx/conf.d
|
COPY --from=builder /app/dist ./dist
|
||||||
|
COPY --from=builder /app/data_template ./data_template
|
||||||
|
|
||||||
USER nginx
|
EXPOSE 4321
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
||||||
EXPOSE 8080
|
CMD ["node", "./dist/server/entry.mjs"]
|
||||||
|
|||||||
Reference in New Issue
Block a user