Optional, dev-first Docker workflow for consistent onboarding and reproducible local development.
Quick Start • Architecture • Dev vs Prod • Commands • Troubleshooting
CyberGauntlet is a frontend-only Vite + React + TypeScript project, but local development can still suffer from:
- Node/runtime drift across contributors
- dependency installation differences across OSes
- "it works on my machine" build/runtime inconsistencies
- hard-to-reset local environments
Docker standardizes the runtime so contributors can focus on building challenges/UI, not debugging setup.
| Category | Traditional Setup | Docker Setup | Practical Advantage |
|---|---|---|---|
| Setup time | Install Node + deps locally | docker compose up --build |
Faster onboarding for new contributors |
| Consistency | Varies by OS/Node tooling | Same container runtime | Reduces environment drift |
| Dependency isolation | Host installs can conflict | Dependencies live in container volumes | Fewer local conflicts |
| Resetability | Manual cleanup/reinstall | docker compose down -v |
Clean slate in one command |
| Reproducibility | Depends on local tooling | Repeatable Dockerfile + pinned base image | Easier bug reproduction |
| Challenge authoring | Depends on host env | Same workflow on all OSes | Consistent experience for contributors |
This Docker implementation provides:
- A containerized dev environment that behaves the same on Windows/macOS/Linux
- A single-command start for contributors (
docker compose up --build) - A production-like workflow for parity checks (
docker-compose.prod.yml)
Docker usage is optional and does not replace the current npm install && npm run dev workflow.
- Docker Desktop (Windows/macOS) OR Docker Engine (Linux)
- Docker Compose v2 (
docker compose ...)
Verify:
docker --version
docker compose versiondocker compose up --buildOpen:
Stop:
docker compose downReset (removes the node_modules volume):
docker compose down -vBest for daily development:
- bind mount for instant edits to
src/andpublic/(includingpublic/challenges/) - named volume for
node_modulesto avoid OS-specific conflicts - healthcheck to signal readiness
docker compose up --buildBest for parity checks:
- builds assets via
npm run build - serves them via
vite preview - no bind mounts (closer to deployment behavior)
docker compose -f docker-compose.prod.yml up --buildOpen:
- Preview: http://localhost:8080
Docker Host (Your OS)
└── http://localhost:5173 -> frontend (Vite dev server, HMR)
This setup intentionally separates:
- Source code (bind mount):
./:/appfor instant edits and HMR - Dependencies (named volume):
/app/node_modulesto avoid:- Windows/macOS permission issues
- host filesystem performance penalties on Docker Desktop shares
- host
node_modulesdrift affecting builds
Targets in Dockerfile:
dev: runsvitewith--host 0.0.0.0on port5173build: generatesdist/vianpm run buildprod: serves the production build viavite previewon port4173
Why multi-stage:
- clean separation of dev and production-like behavior
- better caching (deps layer changes less often than source)
- CI-friendly targets without adding separate Dockerfiles
CyberGauntlet supports optional Supabase integration:
.env.exampledocuments required values- Compose loads
.env.exampleas defaults (safe placeholders) - for real credentials, create a local
.env(do not commit it)
Vite only exposes variables prefixed with VITE_ to the client.
If Docker Engine is running, this single PowerShell command builds, boots, checks readiness, and shuts down:
docker compose up -d --build; $ErrorActionPreference='Stop'; 1..60 | % { try { (Invoke-WebRequest http://localhost:5173 -UseBasicParsing).StatusCode | Out-Null; break } catch { Start-Sleep 2 } }; docker compose ps; docker compose down# Dev stack
docker compose up --build
docker compose up -d --build
docker compose logs -f
docker compose ps
docker compose down
docker compose down -v
# Prod-like stack
docker compose -f docker-compose.prod.yml up --build
docker compose -f docker-compose.prod.yml downIf 5173 is busy, stop the conflicting process or change the port mapping in docker-compose.yml.
CHOKIDAR_USEPOLLING=true is set to improve file watching reliability on Docker Desktop file shares.
If you see errors about the Docker engine/pipe, start Docker Desktop (WSL2 recommended on Windows).
Document Version: 1.1.0
Last Updated: 2026-01-19
Scope: local development tooling only (optional, non-intrusive)