dv/backend/docker-compose.yml

78 lines
1.9 KiB
YAML

version: "3.9"
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: dataviz
POSTGRES_PASSWORD: dataviz_local
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./init-databases.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dataviz"]
interval: 5s
retries: 5
data-service:
build:
context: .
dockerfile: services/data-service/Dockerfile
ports:
- "8001:8000"
environment:
DATABASE_URL: postgresql+asyncpg://dataviz:dataviz_local@postgres:5432/data_db
depends_on:
postgres:
condition: service_healthy
chart-service:
build:
context: .
dockerfile: services/chart-service/Dockerfile
ports:
- "8002:8000"
environment:
DATABASE_URL: postgresql+asyncpg://dataviz:dataviz_local@postgres:5432/chart_db
DATA_SERVICE_URL: http://data-service:8000
depends_on:
postgres:
condition: service_healthy
data-service:
condition: service_started
template-service:
build:
context: .
dockerfile: services/template-service/Dockerfile
ports:
- "8003:8000"
environment:
DATABASE_URL: postgresql+asyncpg://dataviz:dataviz_local@postgres:5432/template_db
depends_on:
postgres:
condition: service_healthy
export-service:
build:
context: .
dockerfile: services/export-service/Dockerfile
ports:
- "8004:8000"
environment:
DATABASE_URL: postgresql+asyncpg://dataviz:dataviz_local@postgres:5432/export_db
DATA_SERVICE_URL: http://data-service:8000
CHART_SERVICE_URL: http://chart-service:8000
depends_on:
postgres:
condition: service_healthy
data-service:
condition: service_started
chart-service:
condition: service_started
volumes:
pgdata: