Fix reproducible frontend Docker deployment

This commit is contained in:
faligam
2026-09-06 16:47:39 +02:00
parent c7b091d1e3
commit 37636e144b
21 changed files with 2799 additions and 85 deletions

View File

@@ -12,24 +12,9 @@ COPY . .
ENV NODE_ENV=production
RUN npm run build || exit 1
# Production stage
FROM node:22-alpine AS runtime
WORKDIR /app
# Copy built assets and dependencies
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY package.json .
# Non-root user
RUN addgroup -S nsct && adduser -S nsct -G nsct
USER nsct
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD wget -qO- http://localhost:3000/health || exit 1
# Production stage: serve the static SvelteKit output.
FROM caddy:2.8-alpine AS runtime
COPY Caddyfile.web /etc/caddy/Caddyfile
COPY --from=builder /app/build /usr/share/caddy
EXPOSE 3000
ENV HOST=0.0.0.0
ENV PORT=3000
CMD ["node", "build"]