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
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
.git
|
||||||
|
.planning
|
||||||
|
*.md
|
||||||
|
.biome
|
||||||
|
.claude
|
||||||
|
.agents
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
# 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"]
|
||||||
Reference in New Issue
Block a user