soaricarus_api CI / Test Suite (pull_request) Successful in 3m36s
soaricarus_api CI / Check (pull_request) Successful in 4m3s
soaricarus_api CI / Rustfmt (pull_request) Successful in 5m49s
soaricarus_api CI / Clippy (pull_request) Successful in 2m24s
soaricarus_api CI / build (pull_request) Successful in 4m32s
160 lines
4.4 KiB
YAML
160 lines
4.4 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 ---
|
|
maze:
|
|
build:
|
|
context: ./garage
|
|
dockerfile: Dockerfile
|
|
container_name: maze
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3900:3900" # S3 API
|
|
- "3901:3901" # RPC for cluster communication
|
|
- "3902:3902" # S3 web interface
|
|
- "3903:3903" # Admin API
|
|
volumes:
|
|
- ./garage.toml:/etc/garage.toml:ro
|
|
- shared_credentials:/shared
|
|
- object_data:/var/lib/garage
|
|
# - ./scripts:/scripts:ro # ← ADD THIS - mount the scripts directory
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
|
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
- GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET}
|
|
- BUCKET_NAME=${S3_BUCKET_NAME}
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3901/v0/status || exit 1"]
|
|
# test: ["CMD-SHELL", "echo 'What is to be done?'"]
|
|
# test: ["CMD-SHELL", "nc -z localhost 3900 || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
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
|
|
object_data:
|
|
driver: local # Use the default local driver
|
|
shared_credentials: # New shared volume
|
|
driver: local
|
|
|
|
networks:
|
|
soaricarus-network:
|
|
driver: bridge
|