Skip to content

chore: fix Docker Compose for local full-stack development#39

Merged
omolobamoyinoluwa-max merged 1 commit into
Virelis:mainfrom
LaPoshBaby:chore/docker-compose-issue-26
May 28, 2026
Merged

chore: fix Docker Compose for local full-stack development#39
omolobamoyinoluwa-max merged 1 commit into
Virelis:mainfrom
LaPoshBaby:chore/docker-compose-issue-26

Conversation

@LaPoshBaby

Copy link
Copy Markdown
Contributor

Summary

Resolves #26

The docker-compose.yml and README quick-start already existed, but docker compose up --build would fail because the backend Dockerfile had a bug: it ran npm ci --omit=dev before npm run build, so tsc (a devDependency) was not available at build time.

Changes

backend/Dockerfile — fix multi-stage build

  • Stage 1 (builder): npm ci (all deps including devDeps) → npm run build (tsc compiles to dist/)
  • Stage 2 (runtime): npm ci --omit=dev → copies only dist/ from builder → lean production image

docker-compose.yml — add healthcheck + proper startup ordering

  • Added healthcheck on the backend service (polls GET /health every 10s)
  • Changed frontend depends_on to condition: service_healthy so the frontend container doesn't start before the backend API is ready

Acceptance criteria

  • docker compose up starts backend on :4000 and frontend on :3000
  • ✅ Env vars documented in docker-compose.yml comments (unchanged, already present)
  • ✅ README updated with Docker quick-start (unchanged, already present)

Tests

  • Backend: 3/3 tests pass (GET /health, GET /api/transfers, POST /api/freeze/build)
  • Frontend: 17/17 tests pass
  • npx tsc --noEmit clean

…relis#26)

- Fix backend Dockerfile: use multi-stage build so tsc (devDependency)
  is available during the build stage; final image uses prod-only deps
- Add healthcheck to backend service in docker-compose.yml
- Change frontend depends_on to wait for backend service_healthy
  so the frontend container doesn't start before the API is ready
@omolobamoyinoluwa-max omolobamoyinoluwa-max merged commit d96555f into Virelis:main May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: add Docker Compose for local full-stack development

2 participants