CI / backend (Postgres 17) (push) Successful in 5m10s
CI / managed Postgres (shared database, emulated, Postgres 17) (push) Successful in 4m20s
CI / backend (Postgres 16) (push) Successful in 5m11s
CI / editor-license (push) Successful in 1m21s
CI / one platform, one account (emulated, Postgres 17) (push) Successful in 1m40s
CI / compose-smoke (push) Successful in 2m17s
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>
62 lines
3.4 KiB
YAML
62 lines
3.4 KiB
YAML
# Galena on a managed PostgreSQL database (the family's shared one, or any Postgres 16/17 reached over
|
|
# a network): 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 lives elsewhere, so the local postgres service is switched off and nothing waits for
|
|
# it; migrate (+seed) and backend otherwise run as in docker-compose.yml. Before the first
|
|
# start, Galena must be provisioned in the database (schema galena, roles galena_migrator /
|
|
# galena_app) and .env must carry its URLs: the provider's host and port (through a pooler, its
|
|
# session mode, never transaction mode), <role>.<tenant> user names where the pooler wants them,
|
|
# URL-encoded passwords and ?sslmode=verify-full&sslrootcert=/run/certs/db-ca.crt. Runbook:
|
|
# db/managed/README.md.
|
|
#
|
|
# Pass -f with BOTH files on every command (ps, logs, run, down), or Compose falls back to the
|
|
# local-postgres stack. The !reset tag needs a Docker Compose release that implements the merge rules
|
|
# documented at docs.docker.com/reference/compose-file/merge/ (2.24.4 or later).
|
|
services:
|
|
postgres:
|
|
# Off: a profile nobody activates keeps the service defined but never starts it.
|
|
profiles: ["local-postgres"]
|
|
|
|
migrate:
|
|
# docker-compose.yml makes migrate wait for the local postgres healthcheck; there is none here.
|
|
# (backend depends only on migrate, so it keeps its ordering.)
|
|
depends_on: !reset null
|
|
environment:
|
|
# The runtime role the grants migration (0006) grants DML to. It must be the role DATABASE_URL
|
|
# logs in as; the migration fails loudly when the role does not exist.
|
|
DB_APP_ROLE: ${DB_APP_ROLE:-galena_app}
|
|
volumes:
|
|
- &managed_db_ca
|
|
# The provider's root CA (downloaded from its dashboard), read-only, at the path the URLs'
|
|
# sslrootcert names. 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:
|
|
DB_APP_ROLE: ${DB_APP_ROLE:-galena_app}
|
|
# The runtime pool per backend process. Every app in the shared database draws on one
|
|
# connection limit: size these with the budget in db/managed/README.md.
|
|
DB_POOL_SIZE: ${DB_POOL_SIZE:-5}
|
|
DB_MAX_OVERFLOW: ${DB_MAX_OVERFLOW:-10}
|
|
# The long-running backend holds no migrator credentials: this empty value overrides the
|
|
# MIGRATION_DATABASE_URL that env_file loads from .env (migrate keeps it). The in-app restore
|
|
# (Administration -> Backups) is then refused with a clear message; restore with the one-shot
|
|
# docker compose -f docker-compose.yml -f docker-compose.managed-db.yml stop backend
|
|
# docker compose -f docker-compose.yml -f docker-compose.managed-db.yml run --rm migrate \
|
|
# python -m app.restore <backup name> --yes
|
|
# docker compose -f docker-compose.yml -f docker-compose.managed-db.yml start backend
|
|
# Opt-in to the in-app restore instead: set BACKEND_MIGRATION_DATABASE_URL in .env to the
|
|
# migrator URL. The running backend then holds credentials that can rewrite the audit log.
|
|
MIGRATION_DATABASE_URL: ${BACKEND_MIGRATION_DATABASE_URL:-}
|
|
volumes:
|
|
- *managed_db_ca
|