| name | deployment |
| description | Set up local development with Docker Compose, hot reload, health checks, and database migrations. Generate docker-compose.yml, Dockerfiles, .env.example, and document the deployment topology. |
Deployment Skill
Local Development Stack
Three-tier architecture:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Frontend │────▶│ Backend │────▶│ PostgreSQL │
│ React/Vite │ │ FastAPI │ │ 16 │
│ :3000 │ │ :8000 │ │ :5432 │
└─────────────┘ └─────────────┘ └─────────────┘
Configuration Files
Copy these templates to the project root when generating deployment artifacts:
templates/docker-compose.yml — Services, volumes, health checks, env setup
templates/Dockerfile.backend.dev — Python 3.12 + FastAPI + hot reload + dependencies
templates/Dockerfile.frontend.dev — Node 20 + Vite + hot reload
templates/.env.example — All required and optional env vars documented
One-Command Start
docker compose up
docker compose up --build
docker compose down
docker compose down -v
Database Migrations
uv run alembic upgrade head
uv run alembic revision --autogenerate -m "description"
uv run alembic downgrade -1
Health Checks
Verify the stack is healthy:
curl http://localhost:8000/health
curl http://localhost:3000
docker compose exec db pg_isready -U postgres
Gotchas
- Missing depends_on with service_healthy — If backend service doesn't specify
depends_on: { db: { condition: service_healthy } }, it will start before the database is ready and fail to connect. Always require the healthcheck condition.
- Hot reload not set up — If volumes don't mount source code (e.g.,
./backend/src:/app/src), developers must rebuild the container on every code change. Specify bind mounts for both backend and frontend.
- Forgotten port mappings — If
ports: ["8000:8000"] is omitted, the service runs but is unreachable from the host. Always expose the dev ports.
- Database password in docker-compose.yml — Never hardcode
POSTGRES_PASSWORD in version control. Use .env files and env_file: .env in docker-compose.yml to pull from environment.
- Missing .env.example — If .env.example doesn't exist, new developers won't know which env vars are required vs. optional. Document every variable: which ones block startup (required), which have defaults, and what values are valid.
- No database health check — If postgres service lacks a healthcheck, the backend starts immediately and fails to connect if the DB is still initializing. Always include a health check with reasonable retries (5+) and timeouts.