Files
Zauberwald/Dockerfile
T
gurix 3f5fc0f960 chore(260329-x2a): add Dockerfile and .dockerignore for containerized deployment
- Multi-stage build: node:22-alpine for build, separate stage for serve
- Runs vite preview on port 4173 with host 0.0.0.0
- config.json mountable at runtime via -v /path/to/config.json:/app/dist/config.json:ro
2026-03-29 23:50:23 +02:00

27 lines
476 B
Docker

# Stage 1 — build
FROM node:22-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Stage 2 — serve
FROM node:22-alpine AS serve
WORKDIR /app
COPY --from=build /app/package*.json ./
RUN npm ci
COPY --from=build /app/dist ./dist
COPY --from=build /app/vite.config.ts ./vite.config.ts
EXPOSE 4173
# Mount config: docker run -v /path/to/config.json:/app/dist/config.json:ro -p 4173:4173 zauberwald
CMD ["npm", "run", "preview"]