1.5 KiB
1.5 KiB
Docker Containerization and Build Fixes
Objectives
- Create a Dockerfile to package the application as a monolith (Node.js + React).
- Fix TypeScript build errors preventing successful compilation.
- Verify the build process.
Changes
- Dockerfile: Created multi-stage build using
node:20-alpine.- Installs dependencies.
- Builds frontend.
- Prunes dev dependencies.
- Server Entry (
src/server/index.ts): Added logic to serve staticdistfiles and handle client-side routing in production. - Package.json: Moved
tsxto dependencies and updatedstartscript. - Code Fixes: Removed unused variables in client and server code used to satisfy strict TypeScript rules:
DeckBuilderView.tsx: Removed unusedpayload.DraftView.tsx: Removed unusedCardComponent.GameView.tsx: Removed unusedmyCommand,oppGraveyard.DraftManager.ts: Removed unusednumPlayers,cardIndex.GameManager.ts: Renamed unused args inshuffleLibrary.
- Helm Chart: Created a complete Helm chart configuration in
helm/mtg-draft-maker:Chart.yaml: Defined chart metadata.values.yaml: Configured defaults (Imagemtg-draft-maker:latest, Port 3000).templates/: Added Deployment, Service, Ingress, and ServiceAccount manifests.- Linted successfully.
Status
- Docker build successful (
docker build -t mtg-draft-maker .). - Helm chart created and linted.
- Ready for K8s deployment.