CI / compose-smoke (push) Successful in 2m17s
CI / deploy-kit-tests (push) Successful in 2m55s
CI / backend (16) (push) Successful in 4m0s
CI / backend (17) (push) Successful in 3m59s
CI / managed-db (push) Successful in 3m55s
deploy kit / preflight (push) Successful in 1m27s
The Dockerfiles still rewrote credentials for github.com only, so the build token never reached Gitea and installs worked only while dredd-core was public. Rewrite http://77.216.148.202:3000/ instead, give every workflow that pip-installs the same rewrite (org secret DREDD_CORE_TOKEN, the read-only haski-reader token), and drop the GitHub PAT leftovers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
67 lines
4.0 KiB
YAML
67 lines
4.0 KiB
YAML
# Atrium on a managed PostgreSQL provider (the family's shared database): an override for docker-compose.yml.
|
|
#
|
|
# DREDD_CORE_TOKEN=<read-only Gitea token> \
|
|
# docker compose -f docker-compose.yml -f docker-compose.managed-db.yml up -d --build
|
|
#
|
|
# The database is the family's shared managed database (one database for Atrium, Galena, Sygna and
|
|
# Counsel Scorecard; Atrium lives in schema `atrium`), so the local postgres service is switched off
|
|
# and nothing waits for it; migrate (+seed), and backend are unchanged otherwise. Atrium must be
|
|
# provisioned first (db/managed/README.md) and .env must carry the managed database's URLs — the
|
|
# provider's session-mode pooler or direct host on port 5432, users atrium_migrator / atrium_app
|
|
# (as `<role>.<tenant>` where the provider's pooler needs the tenant in the user name),
|
|
# ?sslmode=verify-full&sslrootcert=/run/certs/db-ca.crt — plus DB_APP_ROLE=atrium_app.
|
|
# `python backend/scripts/deploy_check.py` checks the .env side before you start.
|
|
#
|
|
# Uses the !reset merge tag (docs.docker.com/reference/compose-file/merge/, "Reset value"), so it needs
|
|
# a Compose v2 release that supports it; `docker compose -f ... -f ... config` shows the merged result.
|
|
# Pass -f with BOTH files on every command (ps, logs, run, down), or Compose falls back to the
|
|
# local-postgres stack.
|
|
#
|
|
# Migrations are not retried on failure: some providers ban a client IP for a while after a few failed
|
|
# password logins in a row, and a retry loop around a wrong password would trigger exactly that.
|
|
services:
|
|
postgres:
|
|
# Off: a profile nobody activates keeps the service defined but never starts it.
|
|
profiles: ["local-postgres"]
|
|
# No data volume and no db/init mount — the schema and roles come from db/managed/provision.sql.
|
|
volumes: !reset []
|
|
|
|
migrate:
|
|
# docker-compose.yml makes migrate wait for the local postgres healthcheck; there is none here.
|
|
# (backend depends only on migrate, so it stays as it is.)
|
|
depends_on: !reset null
|
|
environment:
|
|
# The one-shot migrate service keeps the whole .env: alembic runs as MIGRATION_DATABASE_URL's
|
|
# atrium_migrator, and the seed as DATABASE_URL's atrium_app. 0003_runtime_grants grants the
|
|
# role DB_APP_ROLE names, so an unset DB_APP_ROLE stops here rather than at the migration.
|
|
DB_APP_ROLE: ${DB_APP_ROLE:?set DB_APP_ROLE in .env to the runtime role, atrium_app in the shared database}
|
|
volumes: &managed_db_ca
|
|
# The provider's root CA certificate (downloaded from its dashboard), read-only, at the path the
|
|
# URLs' sslrootcert names. One file serves the whole shared database. create_host_path: false
|
|
# makes a missing file an error at start-up instead of an empty directory in its place.
|
|
- type: bind
|
|
source: ${MANAGED_DB_CA_FILE:-./certs/db-ca.crt}
|
|
target: /run/certs/db-ca.crt
|
|
read_only: true
|
|
bind:
|
|
create_host_path: false
|
|
|
|
backend:
|
|
environment:
|
|
# Least privilege: the long-running backend connects ONLY as atrium_app (DATABASE_URL). Blank
|
|
# the migrator's URL and the local-postgres passwords that `env_file: .env` would otherwise
|
|
# inject, so a compromised backend cannot log in as atrium_migrator and rewrite audit_log.
|
|
# (`environment:` wins over `env_file:`.) Atrium's backend never needs the migrator — it has
|
|
# no in-app restore. (Galena and Sygna do have one; keeping the migrator there is their
|
|
# documented opt-in, with a one-shot restore container as the recommended path.)
|
|
MIGRATION_DATABASE_URL: ""
|
|
DB_MIGRATOR_PASSWORD: ""
|
|
DB_APP_PASSWORD: ""
|
|
POSTGRES_PASSWORD: ""
|
|
# Passed through explicitly so the running configuration is visible here. The pool bounds the
|
|
# connections this backend takes from the shared database's limit (db/managed/README.md).
|
|
DB_APP_ROLE: ${DB_APP_ROLE:?set DB_APP_ROLE in .env to the runtime role, atrium_app in the shared database}
|
|
DB_POOL_SIZE: ${DB_POOL_SIZE:-5}
|
|
DB_MAX_OVERFLOW: ${DB_MAX_OVERFLOW:-10}
|
|
volumes: *managed_db_ca
|