fix(infra): pass pgweb credentials via discrete CLI flags #63

Merged
julien merged 1 commits from fix/infra/pgweb-cli-flags into main 2026-05-08 23:13:18 +02:00
Showing only changes of commit 1ab8bfb212 - Show all commits
+14 -5
View File
@@ -102,11 +102,20 @@ services:
container_name: apf-portal-pgweb
restart: unless-stopped
profiles: [dbtools]
environment:
# `PGWEB_DATABASE_URL` (formerly `DATABASE_URL`) — pgweb 0.16
# deprecated the old name, ignores it, and starts up empty,
# crashing with "Invalid URL".
PGWEB_DATABASE_URL: postgres://${POSTGRES_USER:-portal}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-portal_dev}?sslmode=disable
# Use discrete CLI flags rather than `PGWEB_DATABASE_URL`. The URL
# form is fragile: any special character in POSTGRES_PASSWORD
# (`@`, `#`, `:`, `/`, `?`, `%`, `&`, …) breaks the userinfo
# parser, and the resulting "Invalid URL" error is opaque. Discrete
# flags accept any password verbatim. The image's ENTRYPOINT
# already passes `--bind=0.0.0.0 --listen=8081`; these args are
# appended.
command:
- --host=postgres
- --port=5432
- --user=${POSTGRES_USER:-portal}
- --pass=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set in infra/local/.env}
- --db=${POSTGRES_DB:-portal_dev}
- --ssl=disable
ports:
- '${PGWEB_PORT:-8081}:8081'
depends_on: