diff --git a/infrastructure/docker-compose.dev.yml b/infrastructure/docker-compose.dev.yml index 3401c79..f673f46 100644 --- a/infrastructure/docker-compose.dev.yml +++ b/infrastructure/docker-compose.dev.yml @@ -13,7 +13,7 @@ services: - ../backend/app:/app/app:ro # Hot reload for code changes - ../data:/app/config environment: - - DATABASE_URL=postgresql://truehour:truehour@db:5432/truehour + - DATABASE_URL=${DATABASE_URL:-postgresql://truehour:truehour@db:5432/truehour} - CONFIG_PATH=/app/config/config.json - RELOAD=true # Enable uvicorn auto-reload command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] diff --git a/infrastructure/docker-compose.ghcr-develop.yml b/infrastructure/docker-compose.ghcr-develop.yml index b0a93d2..2997a48 100644 --- a/infrastructure/docker-compose.ghcr-develop.yml +++ b/infrastructure/docker-compose.ghcr-develop.yml @@ -21,7 +21,7 @@ services: ports: - "8000:8000" environment: - - DATABASE_URL=postgresql://truehour:truehour@db:5432/truehour + - DATABASE_URL=${DATABASE_URL:-postgresql://truehour:truehour@db:5432/truehour} - DB_PATH=/app/data/aircraft.db - ENABLE_FAA_LOOKUP=${ENABLE_FAA_LOOKUP:-false} depends_on: @@ -39,6 +39,9 @@ services: - POSTGRES_DB=truehour - POSTGRES_USER=truehour - POSTGRES_PASSWORD=truehour + # postgres:18+ moved PGDATA to /var/lib/postgresql//docker. + # Pin it to the mounted path so the named volume is actually used. + - PGDATA=/var/lib/postgresql/data volumes: - postgres_data:/var/lib/postgresql/data - ./init.sql:/docker-entrypoint-initdb.d/init.sql diff --git a/infrastructure/docker-compose.ghcr.yml b/infrastructure/docker-compose.ghcr.yml index a89e58c..23f4ee9 100644 --- a/infrastructure/docker-compose.ghcr.yml +++ b/infrastructure/docker-compose.ghcr.yml @@ -18,7 +18,7 @@ services: ports: - "8000:8000" environment: - - DATABASE_URL=postgresql://truehour:truehour@db:5432/truehour + - DATABASE_URL=${DATABASE_URL:-postgresql://truehour:truehour@db:5432/truehour} - DB_PATH=/app/data/aircraft.db - ENABLE_FAA_LOOKUP=${ENABLE_FAA_LOOKUP:-false} depends_on: @@ -36,6 +36,9 @@ services: - POSTGRES_DB=truehour - POSTGRES_USER=truehour - POSTGRES_PASSWORD=truehour + # postgres:18+ moved PGDATA to /var/lib/postgresql//docker. + # Pin it to the mounted path so the named volume is actually used. + - PGDATA=/var/lib/postgresql/data volumes: - postgres_data:/var/lib/postgresql/data - ./init.sql:/docker-entrypoint-initdb.d/init.sql diff --git a/infrastructure/docker-compose.yml b/infrastructure/docker-compose.yml index 67fe6b8..66eb127 100644 --- a/infrastructure/docker-compose.yml +++ b/infrastructure/docker-compose.yml @@ -24,7 +24,7 @@ services: volumes: - ../data:/app/config # config.json only environment: - - DATABASE_URL=postgresql://truehour:truehour@db:5432/truehour + - DATABASE_URL=${DATABASE_URL:-postgresql://truehour:truehour@db:5432/truehour} - CONFIG_PATH=/app/config/config.json - ENABLE_FAA_LOOKUP=${ENABLE_FAA_LOOKUP:-false} depends_on: @@ -46,6 +46,9 @@ services: - POSTGRES_USER=${POSTGRES_USER:-truehour} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-truehour} - POSTGRES_DB=${POSTGRES_DB:-truehour} + # postgres:18+ moved PGDATA to /var/lib/postgresql//docker. + # Pin it to the mounted path so the named volume is actually used. + - PGDATA=/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U truehour"] interval: 5s