Files
Zauberwald/.planning/quick/260329-x2a-create-dockerfile-and-dockerignore-for-z/260329-x2a-SUMMARY.md
T
gurix 7efdf98f0c docs(260329-x2a): complete create-dockerfile-and-dockerignore plan
- Add 260329-x2a-SUMMARY.md with decisions and usage docs
- Update STATE.md quick tasks table with commit reference
2026-03-29 23:51:06 +02:00

2.7 KiB

phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
phase plan subsystem tags dependency_graph tech_stack key_files decisions metrics
quick 260329-x2a deployment
docker
deployment
containerization
requires provides affects
docker-image
containerized-deployment
added patterns
node:22-alpine
Docker multi-stage build
multi-stage Docker build
Vite preview server in container
created modified
Dockerfile
.dockerignore
All deps are devDependencies (vite, typescript etc.) so serve stage uses npm ci without --omit=dev to have vite available for vite preview
config.json override via volume mount to dist/config.json (Vite preview serves dist/)
vite.config.ts copied into serve stage so vite preview can read host/port config
duration completed tasks files
<1min 2026-03-29 1 2

Quick Task 260329-x2a: Dockerfile and .dockerignore for Zauberwald

One-liner: Multi-stage Docker build (node:22-alpine) with Vite preview server on port 4173 and runtime config.json override via volume mount.

Tasks Completed

Task Name Commit Files
1 Create Dockerfile and .dockerignore 3f5fc0f Dockerfile, .dockerignore

What Was Built

Dockerfile — Two-stage build:

  • Stage 1 (build): node:22-alpine, installs all deps with npm ci, copies source, runs npm run build (tsc + vite build) producing dist/
  • Stage 2 (serve): node:22-alpine, installs all deps again (needed for vite preview), copies dist/ and vite.config.ts from build stage, exposes port 4173, runs npm run preview

.dockerignore — Excludes node_modules, dist, .git, .planning, *.md, .biome, .claude, .agents from build context.

Usage

# Build the image
docker build -t zauberwald .

# Run with config.json mounted from host
docker run -v /path/to/config.json:/app/dist/config.json:ro -p 4173:4173 zauberwald

The app is then accessible at http://localhost:4173.

Key Decisions

  • All project dependencies are devDependencies (vite, typescript, etc.). The serve stage must run npm ci (without --omit=dev) so that vite is available for npm run preview.
  • public/config.json is intentionally NOT excluded from .dockerignore — it must be baked into dist/ during build. At runtime, users can override it by mounting their own config.json to /app/dist/config.json.
  • vite.config.ts is copied into the serve stage because Vite reads it to apply the host: "0.0.0.0" and port: 4173 preview settings.

Deviations from Plan

None — plan executed exactly as written.

Self-Check: PASSED

  • Dockerfile exists: FOUND
  • .dockerignore exists: FOUND
  • Commit 3f5fc0f exists: FOUND
  • EXPOSE 4173 in Dockerfile: FOUND
  • node_modules in .dockerignore: FOUND