videogen/docker-compose.full.yml
caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

233 lines
7.8 KiB
YAML

# =============================================================================
# ReelForge FULL local stack — one-command, self-contained development env.
#
# cp .env.full.example .env.full # fill in provider keys (optional)
# docker compose -f docker-compose.full.yml up -d
# # …or: make -f Makefile.dev up
#
# This is a NEW, standalone compose file. It does NOT replace, extend, or modify
# docker-compose.reelforge.yml (that stack assumes an EXTERNAL Neon database and
# ships api/worker/beat/redis only). This full stack additionally bundles a LOCAL
# Postgres and the Next.js web frontend so the entire product runs on a laptop
# with zero external accounts.
#
# Services:
# - postgres : Local Postgres 16 (stands in for Neon; NEON_DATABASE_URL points here)
# - redis : Celery broker + result backend AND MPT task-state store
# - migrate : One-shot `alembic upgrade head` (runs to completion, then exits)
# - api : FastAPI (app.asgi:app) via uvicorn on :8080 (/api/v1, /ping, /healthz; /docs is staff-only)
# - worker : Celery worker consuming the `celery` (light) + `render` (heavy) queues
# - beat : Celery beat scheduler (fires the scheduled-publish due-runner /min)
# - web : Next.js frontend (`next start`) on :3000, talking to api on :8080
#
# The api image is built from the EXISTING repo Dockerfile (unchanged). The web
# image is built from ops/web.Dockerfile (a NEW file). Secrets/config come from
# .env.full (see .env.full.example). App config (non-secret) still comes from the
# mounted config.toml, exactly like docker-compose.reelforge.yml.
# =============================================================================
# Build the api/worker/beat/migrate services from the existing repo Dockerfile.
x-api-build: &api-build
build:
context: .
dockerfile: Dockerfile
# Shared bind mounts: live repo code, the app config, and the storage dir so
# api + worker + beat see the same rendered artifacts on the local filesystem.
x-api-volumes: &api-volumes
- ./:/MoneyPrinterTurbo
- ./config.toml:/MoneyPrinterTurbo/config.toml
- ./storage:/MoneyPrinterTurbo/storage
# Secrets + connection env shared by api/worker/beat/migrate. REDIS_HOST is
# pinned to the in-network `redis` service (overrides the localhost default in
# config.py); NEON_DATABASE_URL comes from .env.full and points at `postgres`.
x-api-env: &api-env
env_file:
- .env.full
environment:
REDIS_HOST: redis
PYTHONPATH: /MoneyPrinterTurbo
services:
postgres:
image: postgres:16-alpine
container_name: reelforge-full-postgres
env_file:
- .env.full
ports:
- "127.0.0.1:5432:5432"
volumes:
- reelforge-full-pg-data:/var/lib/postgresql/data
healthcheck:
# Uses the same credentials the app connects with (from .env.full).
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
restart: always
redis:
image: redis:7-alpine
container_name: reelforge-full-redis
command: ["redis-server", "--appendonly", "yes", "--save", "60", "1"]
ports:
- "127.0.0.1:6379:6379"
volumes:
- reelforge-full-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
restart: always
# One-shot schema bootstrap. Runs `alembic upgrade head` against the local
# Postgres and EXITS. api/worker/beat wait for it to complete successfully so
# they never race on the schema or start against an empty database. Kept as a
# dedicated service (never scaled) so concurrent workers never race on
# `alembic upgrade head` — mirrors the note in docker/worker-entrypoint.sh.
migrate:
<<: [*api-build, *api-env]
container_name: reelforge-full-migrate
working_dir: /MoneyPrinterTurbo
entrypoint: ["alembic"]
command: ["upgrade", "head"]
volumes: *api-volumes
depends_on:
postgres:
condition: service_healthy
restart: "no"
api:
<<: [*api-build, *api-env]
container_name: reelforge-full-api
working_dir: /MoneyPrinterTurbo
command:
- uvicorn
- app.asgi:app
- --host
- 0.0.0.0
- --port
- "8080"
ports:
- "127.0.0.1:8080:8080"
volumes: *api-volumes
healthcheck:
# /healthz is always served (no auth, no DB) — a true liveness probe.
# (/openapi.json is staff-only unless MENIVOR_API_DOCS=public.)
test:
- CMD
- python
- -c
- "import urllib.request; urllib.request.urlopen('http://localhost:8080/healthz', timeout=3)"
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
restart: always
worker:
<<: [*api-build, *api-env]
container_name: reelforge-full-worker
working_dir: /MoneyPrinterTurbo
# The existing worker entrypoint validates core-infra secrets and waits for
# Redis before exec-ing the celery command (see docker/worker-entrypoint.sh).
entrypoint: ["/MoneyPrinterTurbo/docker/worker-entrypoint.sh"]
# Consumes both the light `celery` queue and the heavy `render` queue
# (avatar + compose stages are routed to `render` in celery_app.py).
command:
- celery
- -A
- app.workers.celery_app
- worker
- -Q
- celery,render
- --concurrency=2
- --loglevel=info
volumes: *api-volumes
healthcheck:
test: ["CMD", "celery", "-A", "app.workers.celery_app", "inspect", "ping", "-t", "10"]
interval: 30s
timeout: 15s
retries: 5
start_period: 40s
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
restart: always
# Celery beat: the periodic scheduler. Run EXACTLY ONE process (never scale
# >1) — it fires `process_due_publishes_task` every 60s (see `beat_schedule`
# in celery_app.py) to auto-publish reels whose scheduled UTC time has arrived.
# The enqueued task is executed by the `worker` service.
beat:
<<: [*api-build, *api-env]
container_name: reelforge-full-beat
working_dir: /MoneyPrinterTurbo
command:
- celery
- -A
- app.workers.celery_app
- beat
- --loglevel=info
volumes: *api-volumes
depends_on:
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
restart: always
# Next.js frontend. Built from ops/web.Dockerfile (NEW). NEXT_PUBLIC_* values
# are inlined at build time, so they are passed as build args; the browser (on
# the host) reaches the API via the published 127.0.0.1:8080 port.
web:
build:
context: .
dockerfile: ops/web.Dockerfile
args:
NEXT_PUBLIC_API_BASE: ${NEXT_PUBLIC_API_BASE:-http://localhost:8080/api/v1}
NEXT_PUBLIC_APP_API_KEY: ${NEXT_PUBLIC_APP_API_KEY:-local-dev-app-key}
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:-}
container_name: reelforge-full-web
env_file:
- .env.full
environment:
PORT: "3000"
HOSTNAME: "0.0.0.0"
NODE_ENV: production
NEXT_TELEMETRY_DISABLED: "1"
ports:
- "127.0.0.1:3000:3000"
healthcheck:
test:
- CMD
- node
- -e
- "require('http').get('http://localhost:3000/', r => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))"
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
depends_on:
api:
condition: service_healthy
restart: always
volumes:
reelforge-full-pg-data:
reelforge-full-redis-data: