Goal
Deploy the FastAPI backend to Cloud Run in treepolitics-prod, replacing the local docker-compose setup. End state: api.treepolitics.net serves the live API from Cloud Run.
Steps
- Enable required APIs on
treepolitics-prod: run, sqladmin, secretmanager, artifactregistry, cloudbuild.
- Create Artifact Registry Docker repo; build + push first image from the existing
Dockerfile.
- Provision Cloud SQL Postgres (smallest tier, ~$10–15/mo).
- Create Secret Manager secrets:
SECRET_KEY, DATABASE_URL, anything else currently in .env.
- First Cloud Run deploy with Cloud SQL Auth Proxy sidecar.
- Run Alembic migrations against Cloud SQL.
- Smoke-test API endpoints.
- Wire
api.treepolitics.net DNS → Cloud Run.
Done when
Cost estimate
~$10–15/mo (dominated by Cloud SQL).
Notes
Prerequisite for Phase C (frontend wiring) and Phase D (CI/CD).
Goal
Deploy the FastAPI backend to Cloud Run in
treepolitics-prod, replacing the local docker-compose setup. End state:api.treepolitics.netserves the live API from Cloud Run.Steps
treepolitics-prod:run,sqladmin,secretmanager,artifactregistry,cloudbuild.Dockerfile.SECRET_KEY,DATABASE_URL, anything else currently in.env.api.treepolitics.netDNS → Cloud Run.Done when
api.treepolitics.netserves the FastAPI app.envin prod)Cost estimate
~$10–15/mo (dominated by Cloud SQL).
Notes
Prerequisite for Phase C (frontend wiring) and Phase D (CI/CD).