Skip to content

Add docker-compose.yml for one-command local setup #6

@KonstantinMB

Description

@KonstantinMB

Right now setting up local dev requires Python 3.11+, pip, Node 20+, npm, and optionally a Postgres instance. A docker-compose.yml that brings up Postgres + backend + frontend with one command would cut first-time setup from ~15 minutes to ~60 seconds.

What to do

  • Add docker-compose.yml at the repo root with three services:
    • postgres — Postgres 16 with a named volume for persistence, exposes :5432
    • backend — builds from backend/Dockerfile (new file), exposes :8000, depends on postgres, env vars wired up
    • frontend — builds from frontend/Dockerfile (new file), exposes :5173
  • Add backend/Dockerfile (Python 3.11 slim, install requirements, run uvicorn)
  • Add frontend/Dockerfile (Node 20 alpine, install deps, run npm run dev with host binding for Docker)
  • DATABASE_URL in compose should point at the Postgres service hostname (e.g. postgresql://postgres:postgres@postgres:5432/exploreyc)
  • Update README "Quick start" with a Docker alternative below the existing instructions (don't replace them — keep both)

Acceptance criteria

  • docker compose up (no separate build step) starts everything
  • Frontend reachable at http://localhost:5173
  • Backend reachable at http://localhost:8000 with the API responding
  • Database persists across docker compose down && docker compose up
  • .env.example updated if any new env vars are introduced
  • Works on macOS, Linux, and Windows (WSL2)

Pointers

  • backend/main.py reads DATABASE_URL via backend/database_factory.py — point at the Postgres service name
  • Migrations live in supabase/migrations/ — decide whether compose runs them automatically or whether contributors run them manually; document either way
  • Vite dev server needs --host 0.0.0.0 to be reachable from outside the container — see frontend/vite.config.ts

Scope

Touches 3-4 files (compose, 2 Dockerfiles, README). Estimated time: 2-4 hours.

Want to take this on? Comment below and I'll assign it to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions