Fix DB auth: custom Dockerfile bakes trust auth into postgres image

Coolify strips environment variables from image-only services,
so POSTGRES_HOST_AUTH_METHOD=trust never reached the container.
Solution: build a custom DB image with trust auth baked in via
Dockerfile ENV + init script that rewrites pg_hba.conf.
This commit is contained in:
claude 2026-03-15 12:28:25 +00:00
parent ea1c4f4f52
commit 3684e50ac6
2 changed files with 12 additions and 5 deletions

View file

@ -34,12 +34,8 @@ services:
start_period: 30s
db:
image: postgres:16-alpine
build: ./db
restart: unless-stopped
environment:
- POSTGRES_USER=fitness
- POSTGRES_DB=fitness_rewards
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- fitness_db_data:/var/lib/postgresql/data
healthcheck: