Fix: rename db -> fitness-db to avoid DNS collision with Coolify's postgres

ROOT CAUSE FOUND: 'db' resolved to multiple IPs on the Docker network.
Coolify's own PostgreSQL (or another stack's) also responds to 'db'
via the predefined network. Our backend was connecting to the WRONG
postgres — one that requires password auth.

Fix: rename service from 'db' to 'fitness-db' so the hostname is unique.
This commit is contained in:
claude 2026-03-15 21:54:51 +00:00
parent 25d15c38ce
commit 434db38f0d
3 changed files with 6 additions and 8 deletions

View file

@ -16,7 +16,7 @@ services:
build: ./backend
restart: unless-stopped
environment:
- DATABASE_URL=postgresql+asyncpg://fitness@db:5432/fitness_rewards
- DATABASE_URL=postgresql+asyncpg://fitness@fitness-db:5432/fitness_rewards
- SECRET_KEY=8915f64daf616b1b1ea5cdc8242ec924adf263c045bef378d9cb880787ba4386
- STRAVA_CLIENT_ID=211907
- STRAVA_CLIENT_SECRET=d1e48251327a3760acd6dcf4129ec59350dc6b71
@ -24,7 +24,7 @@ services:
- POLAR_CLIENT_SECRET=29890119-2267-4a72-8888-e67ab0c0bf60
- BASE_URL=https://fitness.littlefake.com
depends_on:
db:
fitness-db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
@ -33,7 +33,7 @@ services:
retries: 10
start_period: 30s
db:
fitness-db:
image: postgres:16-alpine
restart: unless-stopped
environment: