Files
mtg-online-drafter/docs/development/devlog/2025-12-14-235700_docker_containerization.md
2025-12-14 22:55:00 +01:00

1.1 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 static dist files and handle client-side routing in production.
  • Package.json: Moved tsx to dependencies and updated start script.
  • Code Fixes: Removed unused variables in client and server code used to satisfy strict TypeScript rules:
    • DeckBuilderView.tsx: Removed unused payload.
    • DraftView.tsx: Removed unused CardComponent.
    • GameView.tsx: Removed unused myCommand, oppGraveyard.
    • DraftManager.ts: Removed unused numPlayers, cardIndex.
    • GameManager.ts: Renamed unused args in shuffleLibrary.

Status

  • Docker build successful (docker build -t mtg-draft-maker .).
  • Image ready for deployment.