Avoids conflict with other local Postgres instances. Container internal port stays 5432; only the host-side mapping changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
937 B
YAML
37 lines
937 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: food_ai
|
|
POSTGRES_USER: food_ai
|
|
POSTGRES_PASSWORD: food_ai_local
|
|
ports:
|
|
- "5433:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U food_ai -d food_ai"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "9090:8080"
|
|
environment:
|
|
DATABASE_URL: postgres://food_ai:food_ai_local@postgres:5432/food_ai?sslmode=disable
|
|
FIREBASE_CREDENTIALS_FILE: /app/firebase-credentials.json
|
|
JWT_SECRET: local-dev-secret-change-in-prod
|
|
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:9090
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./firebase-credentials.json:/app/firebase-credentials.json:ro
|
|
|
|
volumes:
|
|
pgdata:
|