85 lines
2.1 KiB
YAML
85 lines
2.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: always
|
|
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
|
|
network: host
|
|
restart: always
|
|
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
|
|
network: host
|
|
restart: always
|
|
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
|
|
network: host
|
|
restart: always
|
|
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
|
|
network: host
|
|
restart: always
|
|
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:
|