Files
soaricarus_api/docker-compose.yaml
T
phoenix 8a64a71339
Rust CI / Test Suite (push) Successful in 3m43s
Rust CI / Rustfmt (push) Successful in 2m2s
Rust CI / Check (push) Successful in 3m9s
Rust CI / build (push) Successful in 2m58s
Rust CI / Clippy (push) Successful in 4m28s
Update postgres (#252)
Reviewed-on: phoenix/icarus#252
2026-07-09 11:05:12 -04:00

120 lines
3.1 KiB
YAML

version: '3.8' # Use a recent version
services:
# --- Web API ---
api:
build:
context: .
ssh: ["default"]
container_name: icarus
ports:
- "8000:8000"
env_file:
- .env
depends_on:
main_db:
condition: service_healthy
networks:
- icarus-network
restart: unless-stopped
# --- Web API auth ---
auth_api:
build:
context: ../icarus_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:
- ../icarus_auth/.env
depends_on:
auth_db:
condition: service_healthy
networks:
- icarus-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:
- icarus-network
# PostgreSQL Database Service
main_db:
image: postgres:18.4-alpine
container_name: icarus_db
environment:
# These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_MAIN_USER:-icarus}
POSTGRES_PASSWORD: ${POSTGRES_MAIN_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_MAIN_DB:-icarus_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:
- icarus-network
# --- icarus web auth api db ---
auth_db:
image: postgres:18.4-alpine
container_name: icarus_auth_db
environment:
# These MUST match the user, password, and database name in the DATABASE_URL above
POSTGRES_USER: ${POSTGRES_AUTH_USER:-icarus_op}
POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_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:
- icarus-network
volumes:
postgres_data:
driver: local # Use the default local driver
postgres_data_auth:
driver: local # Use the default local driver
networks:
icarus-network:
driver: bridge