initial
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# ============================================================================
|
||||
# Generated by mcma-bootstrap — DO NOT EDIT, DO NOT COMMIT.
|
||||
# Regenerate with `make deploy`. All values come from .env.deploy.
|
||||
# ============================================================================
|
||||
services:
|
||||
@@ -0,0 +1,20 @@
|
||||
# -- backend: one image, two roles (API server + arq worker) -------------
|
||||
api:
|
||||
image: ${BACKEND_IMAGE}:${MCMA_IMAGE_TAG}
|
||||
restart: unless-stopped
|
||||
env_file: .env.deploy
|
||||
volumes:
|
||||
- ${MEDIA_HOST_PATH}:${MEDIA_PATH}
|
||||
- transcode_cache:${TRANSCODE_CACHE_PATH}
|
||||
@API_PORTS@
|
||||
@API_DEPENDS@
|
||||
|
||||
worker:
|
||||
image: ${BACKEND_IMAGE}:${MCMA_IMAGE_TAG}
|
||||
restart: unless-stopped
|
||||
command: arq app.workers.arq_worker.WorkerSettings
|
||||
env_file: .env.deploy
|
||||
volumes:
|
||||
- ${MEDIA_HOST_PATH}:${MEDIA_PATH}
|
||||
- transcode_cache:${TRANSCODE_CACHE_PATH}
|
||||
@WORKER_DEPENDS@
|
||||
@@ -0,0 +1,16 @@
|
||||
# -- reverse proxy: single entrypoint, same-origin for webui + API -------
|
||||
# Required when the webui is deployed: the prebuilt webui image bakes a
|
||||
# same-origin '/api/v1' base URL and only serves static assets, so a proxy
|
||||
# must route /api, /health and /rest to the backend.
|
||||
caddy:
|
||||
image: caddy:2-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
@CADDY_PORTS@
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- caddy_data:/data
|
||||
- caddy_config:/config
|
||||
depends_on:
|
||||
- api
|
||||
- webui
|
||||
@@ -0,0 +1,26 @@
|
||||
# -- built-in S3 (MinIO) + one-shot bucket creation ----------------------
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
restart: unless-stopped
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${S3_ACCESS_KEY}
|
||||
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY}
|
||||
volumes:
|
||||
- miniodata:/data
|
||||
|
||||
# Waits for MinIO to accept connections, then creates the bucket. Runs once
|
||||
# (restart: no) and exits 0 — `compose up --wait` treats that as complete.
|
||||
minio-setup:
|
||||
image: minio/mc:latest
|
||||
restart: "no"
|
||||
depends_on:
|
||||
- minio
|
||||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
until mc alias set mcma http://minio:9000 ${S3_ACCESS_KEY} ${S3_SECRET_KEY}; do
|
||||
echo 'waiting for minio...'; sleep 2;
|
||||
done &&
|
||||
mc mb --ignore-existing mcma/${S3_BUCKET} &&
|
||||
echo 'bucket ready'
|
||||
"
|
||||
@@ -0,0 +1,15 @@
|
||||
# -- built-in Postgres ---------------------------------------------------
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -0,0 +1,12 @@
|
||||
# -- built-in Redis (cache + arq broker) ---------------------------------
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
restart: unless-stopped
|
||||
command: redis-server --save 60 1 --loglevel warning
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@@ -0,0 +1,11 @@
|
||||
# -- webui: prebuilt static SPA (served on :80 inside the container) ------
|
||||
# The browser-facing API base URL is injected at container start from
|
||||
# PUBLIC_API_BASE_URL (window.__APP_CONFIG__) — no rebuild needed.
|
||||
webui:
|
||||
image: ${WEBUI_IMAGE}:${MCMA_IMAGE_TAG}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PUBLIC_API_BASE_URL: ${PUBLIC_API_BASE_URL}
|
||||
@WEBUI_PORTS@
|
||||
depends_on:
|
||||
- api
|
||||
Reference in New Issue
Block a user