# Local development stack. Production is provisioned via Ansible (S37); # this file is for `make dev-db` and friends. # # Services: # postgres — primary database (Postgres 16, S01) # minio — S3-compatible object store (S04) # mailhog — local SMTP catcher (S05) # # Each is volume-backed for dev persistence and bound to localhost only. name: shithub-dev services: postgres: image: postgres:16 container_name: shithub-postgres restart: unless-stopped environment: POSTGRES_USER: shithub POSTGRES_PASSWORD: shithub_dev POSTGRES_DB: shithub ports: - "127.0.0.1:5432:5432" volumes: - shithub-pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U shithub -d shithub"] interval: 5s timeout: 3s retries: 10 start_period: 10s command: - "postgres" - "-c" - "shared_preload_libraries=pg_stat_statements" - "-c" - "log_statement=none" - "-c" - "max_connections=100" # S3-compatible object storage. Non-default seed credentials — # MinIO's defaults (minioadmin/minioadmin) are insecure even in dev. minio: image: minio/minio:latest container_name: shithub-minio restart: unless-stopped environment: MINIO_ROOT_USER: shithub-dev MINIO_ROOT_PASSWORD: shithub-dev-secret-please-change ports: - "127.0.0.1:9000:9000" # S3 API - "127.0.0.1:9001:9001" # web console volumes: - shithub-miniodata:/data command: server /data --console-address ":9001" healthcheck: test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9000/minio/health/live"] interval: 5s timeout: 3s retries: 10 start_period: 10s # Local SMTP catcher (S05). The shithub auth flow writes signup / # password-reset emails here when SHITHUB_AUTH__EMAIL_BACKEND=smtp. # Web UI: http://127.0.0.1:8025 # # We use Mailpit instead of the original MailHog: it's the actively # maintained successor, ships native arm64 + amd64 images (so Apple # Silicon hosts don't run it under x86 emulation), keeps the same # SMTP/UI port shape, and offers the same "swallow all mail and # show it in a web UI" semantics. mailhog: image: axllent/mailpit:latest container_name: shithub-mailhog restart: unless-stopped environment: MP_SMTP_BIND_ADDR: "0.0.0.0:1025" MP_UI_BIND_ADDR: "0.0.0.0:8025" ports: - "127.0.0.1:1025:1025" # SMTP - "127.0.0.1:8025:8025" # web UI # One-shot init: creates the shithub-dev bucket via mc. minio-init: image: minio/mc:latest container_name: shithub-minio-init depends_on: minio: condition: service_healthy entrypoint: - "/bin/sh" - "-c" - | set -eu mc alias set local http://minio:9000 shithub-dev shithub-dev-secret-please-change mc mb --ignore-existing local/shithub-dev echo "minio-init: bucket shithub-dev ready" volumes: shithub-pgdata: name: shithub-pgdata shithub-miniodata: name: shithub-miniodata