mirror of
https://github.com/Dokploy/templates.git
synced 2026-07-16 19:35:26 +02:00
The postgres healthcheck ran pg_isready without -U while POSTGRES_USER
was set to logto, so every probe attempted to connect as role
"postgres" and spammed FATAL: role "postgres" does not exist.
Pass -U logto -d logto explicitly and set POSTGRES_DB.
Also fix LOGTO_ENDPOINT pointing at the admin domain instead of the
main domain, update Logto 1.27.0 -> 1.41.0, use ${password:32} for the
generated password, drop the ephemeral host port publishing and add
restart policies.
Closes #130
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
34 lines
932 B
YAML
34 lines
932 B
YAML
services:
|
|
app:
|
|
image: ghcr.io/logto-io/logto:1.41.0
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
entrypoint: ["sh", "-c", "npm run cli db seed -- --swe && npm start"]
|
|
environment:
|
|
TRUST_PROXY_HEADER: 1
|
|
DB_URL: postgres://logto:${LOGTO_POSTGRES_PASSWORD}@postgres:5432/logto
|
|
ENDPOINT: ${LOGTO_ENDPOINT}
|
|
ADMIN_ENDPOINT: ${LOGTO_ADMIN_ENDPOINT}
|
|
volumes:
|
|
- logto-connectors:/etc/logto/packages/core/connectors
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: logto
|
|
POSTGRES_PASSWORD: ${LOGTO_POSTGRES_PASSWORD}
|
|
POSTGRES_DB: logto
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U logto -d logto"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
logto-connectors:
|
|
postgres-data:
|