37 lines
917 B
YAML
37 lines
917 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: svg-service-postgres
|
|
env_file:
|
|
- ./.env
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
ports:
|
|
- "5434:5432"
|
|
volumes:
|
|
- ./postgres-data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
|
|
svg-service:
|
|
build:
|
|
context: ./backend
|
|
container_name: svg-service
|
|
env_file:
|
|
- ./.env
|
|
command: ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${BACKEND_PORT}"]
|
|
ports:
|
|
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
|
volumes:
|
|
- ./storage:${STORAGE_ROOT}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|