Files
soaricarus_api/docker-compose.yaml
T
phoenix 6392169878
soaricarus_api CI / Rustfmt (pull_request) Successful in 5m54s
soaricarus_api CI / Check (pull_request) Successful in 6m4s
soaricarus_api CI / Test Suite (pull_request) Successful in 7m40s
soaricarus_api CI / build (pull_request) Successful in 3m18s
soaricarus_api CI / Clippy (pull_request) Successful in 4m41s
Saving changes. Just going to stick with one docker service for storage
2026-08-04 12:34:39 -04:00

188 lines
5.5 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
volumes:
- shared_credentials:/shared:ro # Mount as read-only
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
# --- storage service ---
garage:
image: dxflrs/garage:v2.3.0 # Use official Garage image
container_name: garage
restart: unless-stopped
environment:
# Garage configuration via environment variables
GARAGE_SERVER_BIND_ADDR: "0.0.0.0:3900"
GARAGE_SERVER_BIND_PUBLIC_ADDR: "0.0.0.0:3901"
GARAGE_S3_API_S3_REGION: "garage"
GARAGE_S3_API_BIND_ADDR: "0.0.0.0:3900"
GARAGE_S3_API_PUBLIC_BIND_ADDR: "0.0.0.0:3901"
GARAGE_S3_API_PUBLIC_ADDRS: "http://localhost:3901"
GARAGE_S3_API_ROOT_DOMAIN: "garage.local"
GARAGE_ADMIN_BIND_ADDR: "0.0.0.0:3902"
GARAGE_ADMIN_PUBLIC_BIND_ADDR: "0.0.0.0:3902"
# Cluster configuration (single node for simplicity)
GARAGE_CLUSTER_REPLICATION_MODE: "none" # Single node
GARAGE_CLUSTER_PEER_REPLICATION_STRATEGY: "ring"
# Data storage
GARAGE_DATA_DIR: "/data"
GARAGE_METADATA_DIR: "/data/meta"
# RPC configuration
GARAGE_RPC_PUBLIC_ADDR: "http://garage:3901"
GARAGE_RPC_BIND_ADDR: "0.0.0.0:3901"
GARAGE_RPC_SECRET: "${GARAGE_RPC_SECRET:-changeme12345678901234567890123456789012}" # 32+ chars
# Web Admin
GARAGE_ADMIN_TOKEN: "${GARAGE_ADMIN_TOKEN:-garage-admin-token}"
# Logging
GARAGE_LOG_LEVEL: "info"
GARAGE_S3_BUCKET: "${S3_BUCKET_NAME}:-soaricarus-storage"
volumes:
# - garage_data:/data # Persist Garage data
- ./garage.toml:/etc/garage.toml:ro # Mount config file
- shared_credentials:/data # Persist Garage data
ports:
- "3900:3900" # S3 API
- "3901:3901" # S3 API public
- "3902:3902" # Admin API
# entrypoint: ["/bin/bash", "-c"]
# command:
# - |
# ls /
# /garage -c /etc/garage.toml server
command: ["/garage", "-c", "/etc/garage.toml", "server"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3900/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- soaricarus-network
extra_hosts:
- "garage.local:127.0.0.1" # Needed for local domain resolution
# 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
object_data:
driver: local # Use the default local driver
shared_credentials: # New shared volume
driver: local
networks:
soaricarus-network:
driver: bridge