2026-06-16 15:21:43 +02:00
|
|
|
# Self-contained local development stack — Postgres + API + scheduler, all on this machine.
|
2026-06-11 16:35:00 +02:00
|
|
|
#
|
2026-06-16 15:21:43 +02:00
|
|
|
# Fully decoupled: its own local database (a Docker volume) and its own scheduler, so there
|
|
|
|
|
# is no shared DB and no migration coupling with any other instance. Edit code, rebuild, and
|
|
|
|
|
# everything (including the background sync) runs right here.
|
2026-06-11 16:35:00 +02:00
|
|
|
#
|
2026-06-16 15:21:43 +02:00
|
|
|
# docker compose -f docker-compose.localdev.yml up -d --build
|
2026-06-11 16:35:00 +02:00
|
|
|
#
|
2026-06-16 15:21:43 +02:00
|
|
|
# Browse at http://localhost:8080 — Google login works because the OAuth redirect is
|
|
|
|
|
# http://localhost:8080/auth/callback. The API runs `alembic upgrade head` on startup, so it
|
|
|
|
|
# applies local migrations to THIS local DB only. Seed the catalog once with a pg_dump from
|
|
|
|
|
# another instance if you want real data (see RUNBOOK).
|
2026-06-11 16:35:00 +02:00
|
|
|
|
|
|
|
|
services:
|
2026-06-16 15:21:43 +02:00
|
|
|
db:
|
|
|
|
|
image: postgres:16-alpine
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: ${POSTGRES_USER:-subfeed}
|
|
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-subfeed}
|
|
|
|
|
POSTGRES_DB: ${POSTGRES_DB:-subfeed}
|
|
|
|
|
volumes:
|
|
|
|
|
- pgdata:/var/lib/postgresql/data
|
|
|
|
|
security_opt:
|
|
|
|
|
- apparmor:unconfined
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-subfeed} -d ${POSTGRES_DB:-subfeed}"]
|
|
|
|
|
interval: 5s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 12
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
2026-06-11 16:35:00 +02:00
|
|
|
api:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: Dockerfile
|
2026-06-15 00:06:57 +02:00
|
|
|
args:
|
|
|
|
|
APP_VERSION: ${APP_VERSION:-dev}
|
|
|
|
|
GIT_SHA: ${GIT_SHA:-unknown}
|
|
|
|
|
BUILD_DATE: ${BUILD_DATE:-}
|
2026-06-11 16:35:00 +02:00
|
|
|
env_file: .env
|
|
|
|
|
environment:
|
2026-06-16 15:21:43 +02:00
|
|
|
# Own local database (overrides whatever DATABASE_URL is in .env).
|
|
|
|
|
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-subfeed}:${POSTGRES_PASSWORD:-subfeed}@db:5432/${POSTGRES_DB:-subfeed}
|
|
|
|
|
# This instance owns its scheduler now (its own DB, so no double-write concern).
|
|
|
|
|
SCHEDULER_ENABLED: "true"
|
|
|
|
|
depends_on:
|
|
|
|
|
db:
|
|
|
|
|
condition: service_healthy
|
2026-06-11 16:42:44 +02:00
|
|
|
# Harmless on Docker Desktop; needed if ever run under Docker-in-LXC.
|
|
|
|
|
security_opt:
|
|
|
|
|
- apparmor:unconfined
|
2026-06-11 16:35:00 +02:00
|
|
|
ports:
|
|
|
|
|
- "${APP_PORT:-8080}:8000"
|
|
|
|
|
restart: unless-stopped
|
2026-06-16 15:21:43 +02:00
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
pgdata:
|