Files
soaricarus_api/docker-compose.yaml
T
phoenix 59a7e31641
soaricarus_api CI / Check (push) Successful in 3m21s
soaricarus_api CI / Test Suite (push) Successful in 4m25s
soaricarus_api CI / Rustfmt (push) Successful in 3m8s
soaricarus_api CI / Clippy (push) Successful in 3m56s
soaricarus_api CI / build (push) Successful in 3m3s
Updating name (#253)
Reviewed-on: #253
2026-07-21 15:28:48 -04:00

120 lines
3.2 KiB
YAML

version: '3.8' # Use a recent version
services:
# --- Web API ---
api:
build:
context: .
ssh: ["default"]
container_name: soaricarus
ports:
- "8000:8000"
env_file:
- .env
depends_on:
main_db:
condition: service_healthy
networks:
- soaricarus-network
restart: unless-stopped
# --- Web API auth ---
auth_api:
build:
context: ../soaricarus_auth # IMPORTANT: Relative path to the local checkout of your web API repo (containing the Dockerfile)
ssh: ["default"]
dockerfile: Dockerfile # Optional: Specify if your Dockerfile has a non-standard name
container_name: auth_api
restart: unless-stopped
ports:
- "8001:8001"
env_file:
- ../soaricarus_auth/.env
depends_on:
auth_db:
condition: service_healthy
networks:
- soaricarus-network
# Optional: Mount local code for development (live reload)
# volumes:
# - ./path/to/your/web-api-repo:/app
# --- songparser service ---
songparser:
build:
context: ../songparser
ssh: ["default"]
dockerfile: Dockerfile
container_name: songparser
restart: unless-stopped
env_file:
- ../songparser/.env
depends_on:
- api
- main_db
- auth_api
- auth_db
networks:
- soaricarus-network
# PostgreSQL Database Service
main_db:
image: postgres:18.4-alpine
container_name: soaricarus_db
environment:
# These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_MAIN_USER:-soaricarus}
POSTGRES_PASSWORD: ${POSTGRES_MAIN_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_MAIN_DB:-soaricarus_db}
volumes:
# Persist database data using a named volume
- postgres_data:/var/lib/postgresql
ports:
- "5432:5432"
healthcheck:
# Checks if Postgres is ready to accept connections
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
networks:
- soaricarus-network
# --- soaricarus web auth api db ---
auth_db:
image: postgres:18.4-alpine
container_name: soaricarus_auth_db
environment:
# These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_AUTH_USER:-soaricarus_op}
POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_AUTH_DB:-soaricarus_auth_db}
volumes:
# Persist database data using a named volume
- postgres_data_auth:/var/lib/postgresql
ports:
- "5433:5432"
healthcheck:
# Checks if Postgres is ready to accept connections
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
networks:
- soaricarus-network
volumes:
postgres_data:
driver: local # Use the default local driver
postgres_data_auth:
driver: local # Use the default local driver
networks:
soaricarus-network:
driver: bridge