Overview
This template provides a PostgreSQL runnable exposing port 5432 with a persistent data volume. Use it directly for quick starts, or inherit it in your app and wire credentials via Monk secrets.Quick start (run directly)
localhost:5432 with the default credentials from postgres.yml.
Configuration
Key variables inpostgres.yml (under postgresql/db):
Inherit and use secrets (recommended)
Ports and persistence
- Service:
postgreson TCP5432 - Data path:
${monk-volume-path}/postgresql:/var/lib/postgresql/data
Credential updates
This template includes a custom entrypoint that automatically updates the database password when thePOSTGRES_PASSWORD environment variable changes. Unlike the default PostgreSQL Docker image behavior (which only applies credentials on first initialization), this template ensures password changes take effect on existing databases.
When the container starts:
- If an existing database is detected, the entrypoint updates the user password via
ALTER USER - If it’s a fresh initialization, credentials are applied normally by the PostgreSQL image
Troubleshooting
- Ensure the host volume is writable by the container.
- Check container logs (
monk logs postgresql/db) if credential updates fail.

