53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
# Keep `db` as the first service: clearer dependency order and predictable compose overrides.
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: game
|
|
POSTGRES_PASSWORD: game
|
|
POSTGRES_DB: star_wars_grid
|
|
volumes:
|
|
- ./data/postgres:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U game -d star_wars_grid"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 15
|
|
start_period: 5s
|
|
|
|
users_db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: users
|
|
POSTGRES_PASSWORD: users
|
|
POSTGRES_DB: star_wars_users
|
|
volumes:
|
|
- ./data/postgres_users:/var/lib/postgresql/data
|
|
ports:
|
|
- "5433:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U users -d star_wars_users"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 15
|
|
start_period: 5s
|
|
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
DATABASE_URL: postgres://game:game@db:5432/star_wars_grid
|
|
USERS_DATABASE_URL: postgres://users:users@users_db:5432/star_wars_users
|
|
JWT_SECRET: change_me_in_production_please
|
|
PORT: "8080"
|
|
CONFIG_FILE_PATH: /app/config/game.settings.json
|
|
volumes:
|
|
- ./config:/app/config
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
users_db:
|
|
condition: service_healthy |