Skip to content

Add Docker Compose setup for full-stack local development#15

Open
anshjaiswal12 wants to merge 1 commit intoClimate-Vision:mainfrom
anshjaiswal12:feature/docker-compose-setup
Open

Add Docker Compose setup for full-stack local development#15
anshjaiswal12 wants to merge 1 commit intoClimate-Vision:mainfrom
anshjaiswal12:feature/docker-compose-setup

Conversation

@anshjaiswal12
Copy link
Copy Markdown

Resolves #13.

What was added

  • Full docker-compose.yml configuration linking the FastAPI backend and React Vite frontend.
  • CPU optimization layer in the backend Dockerfile using the --extra-index-url pip parameter preventing multi-gigabyte NVIDIA GPU metadata from downloading recursively for local API contexts.
  • Advanced Volume caching preventing local container node cache collisions.
  • Clear onboarding instructions directly integrated within README.md.

How to test

  1. cp .env.example .env && cp frontend/.env.example frontend/.env
  2. Run docker-compose up -d --build
  3. See API running at http://localhost:8000/docs and frontend at http://localhost:5173

Why it improves DX

Local environment onboarding is extremely unified, ensuring engineers bypass OS-dependency nuances directly through Docker mappings orchestrating both ends simultaneously while maintaining HMR.

@Goldokpa Goldokpa requested a review from Oshgig April 22, 2026 15:47
Copy link
Copy Markdown
Member

@Goldokpa Goldokpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution @anshjaiswal12 — Docker Compose support is exactly what was needed for issue #13. The overall approach is solid: the node_modules volume trick, BACKEND_URL proxy in vite.config.ts, and restart policies are all correct. However there are blocking issues before this can merge.

MUST FIX:

  1. PR targets main instead of develop — Per CONTRIBUTING.md all PRs must target develop. Please change the base branch using the Edit button at the top of this PR.
  2. Backend Dockerfile missing CPU-only pip flag — The PR description mentions preventing multi-GB NVIDIA downloads, but the Dockerfile does not include --extra-index-url https://download.pytorch.org/whl/cpu. Without this, PyTorch will pull CUDA wheels and the image will exceed several GB. Add this flag to the pip install line or provide a requirements-docker.txt pinning CPU wheels.
  3. No healthcheck — frontend starts before backend is readydepends_on: backend only waits for container start, not for FastAPI to be ready. Add a healthcheck on the backend service and use condition: service_healthy in the frontend depends_on. The /health endpoint already exists in the app.
  4. Backend volume .:/app mounts everything — This is intentional for hot-reload but should be documented with a comment, and it means the Dockerfile COPY is ignored at runtime.
    SUGGESTIONS (non-blocking):
  • Remove the 3000:3000 port — "in case it's overridden" is not a good pattern; document the env var override instead.
    • Note in README that the frontend .env copy step is not required for Docker Compose (BACKEND_URL is set via compose env, not .env).
      • Add a note that this is a dev-only setup and a production Dockerfile (nginx + built assets) is a separate follow-up.
        What's done well: .dockerignore files are correct, vite.config.ts proxy change is non-breaking for manual setup, README section is clear and well-structured.

Please retarget to develop and address items 1-3 — happy to approve once those are done!

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.

[Good First Issue] Add Docker Compose for full-stack local development

2 participants