51 lines
1.0 KiB
YAML
51 lines
1.0 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ballistic
|
|
POSTGRES_USER: ballistic
|
|
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ballistic"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
local_net:
|
|
aliases:
|
|
- ${COMPOSE_PROJECT_NAME}-db
|
|
|
|
web:
|
|
build: .
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: "postgresql+psycopg://ballistic:${DB_PASSWORD}@db:5432/ballistic"
|
|
STORAGE_ROOT: "/app/storage"
|
|
volumes:
|
|
- app_storage:/app/storage
|
|
- .:/app # bind-mount source so code changes are live without a rebuild
|
|
networks:
|
|
local_net:
|
|
aliases:
|
|
- ${COMPOSE_PROJECT_NAME}-web
|
|
|
|
|
|
|
|
volumes:
|
|
postgres_data:
|
|
app_storage:
|
|
|
|
|
|
networks:
|
|
local_net:
|
|
name: ${NETWORK}
|
|
external: true
|