PostgreSQL administration patterns for shared multi-database instances, init scripts, user management, pgAdmin access, emergency queries, and backup/restore operations in Docker Compose self-hosted environments.
PostgreSQL 16 Alpine serves as the shared relational database for multiple applications on
the SOL server. Two databases (gitea and keycloak) run on a single instance with
dedicated users. The instance is exposed only on localhost (127.0.0.1:5432) to prevent
external access. Administration happens via pgAdmin (protected by OAuth2 Proxy + Keycloak)
or via docker exec commands. All containers connect through the shared Docker network
using the hostname postgres.