Files
coreapp-dev/templates/postgres
davidandClaude Opus 5.5 d8c6d1011f coreapp new --postgres --sso: database and sign-in together
Overlays no longer replace service: each names the Core apps it needs in
.depends, merged into DEPENDS. The sign-in code is a module (oidc.py)
that examples import; templates/postgres-sso is the combined example
(sign-in, each person's visits counted in PostgreSQL). Tested with
team-visits, including sign-in in a browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 12:43:22 -07:00
..

## Database

The app has its own database on the Core's shared PostgreSQL
(`DEPENDS="postgresql"` in `service`):

- `install` creates the user and database `{{DBNAME}}`, with the random
  `DB_PASSWORD` from `.env`; `uninstall` drops both (`coreapp remove`
  deletes the data).
- The app reads `DB_HOST` (`postgresql.<domain>`, which only resolves on the
  Core's `core` network), `DB_PORT`, `DB_NAME`, `DB_USER` and `DB_PASSWORD`
  from its environment. `app.py` shows how, with `psycopg`.
- Look at the data: `coreapp-vm ssh docker exec -it postgresql psql -U postgres {{DBNAME}}`.