- Rename src/materia/ → src/beanflows/ (Python package)
- Rename transform/sqlmesh_materia/ → transform/sqlmesh_beanflows/
- Rename infra/supervisor/materia-supervisor.service → beanflows-supervisor.service
- Rename infra/backup/materia-backup.{service,timer} → beanflows-backup.{service,timer}
- Update all path strings: /opt/materia → /opt/beanflows, /data/materia → /data/beanflows
- Update pyproject.toml: project name, CLI entrypoint, workspace source key
- Update all internal imports from materia.* → beanflows.*
- Update infra scripts: REPO_DIR, service names, systemctl references
- Fix docker-compose.prod.yml: /data/materia → /data/beanflows (bind mount path)
Intentionally left unchanged: Pulumi stack name (materia-infrastructure) and
Hetzner resource names ("materia-key", "managed_by: materia") — these reference
live cloud infrastructure and require separate cloud-side renames.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
133 lines
3.2 KiB
YAML
133 lines
3.2 KiB
YAML
services:
|
|
# ── Always-on infrastructure ──────────────────────────────
|
|
|
|
router:
|
|
image: nginx:alpine
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5001:80"
|
|
volumes:
|
|
- ./router/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
networks:
|
|
- net
|
|
healthcheck:
|
|
test: ["CMD", "nginx", "-t"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
|
|
litestream:
|
|
image: litestream/litestream:latest
|
|
restart: unless-stopped
|
|
command: replicate -config /etc/litestream.yml
|
|
volumes:
|
|
- app-data:/app/data
|
|
- ./litestream.yml:/etc/litestream.yml:ro
|
|
|
|
# ── Blue slot ─────────────────────────────────────────────
|
|
|
|
blue-app:
|
|
profiles: ["blue"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
- SERVING_DUCKDB_PATH=/data/beanflows/analytics.duckdb
|
|
volumes:
|
|
- app-data:/app/data
|
|
- /data/beanflows:/data/beanflows:ro
|
|
networks:
|
|
- net
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
blue-worker:
|
|
profiles: ["blue"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
command: python -m beanflows.worker
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
volumes:
|
|
- app-data:/app/data
|
|
networks:
|
|
- net
|
|
|
|
blue-scheduler:
|
|
profiles: ["blue"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
command: python -m beanflows.worker scheduler
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
volumes:
|
|
- app-data:/app/data
|
|
networks:
|
|
- net
|
|
|
|
# ── Green slot ────────────────────────────────────────────
|
|
|
|
green-app:
|
|
profiles: ["green"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
- SERVING_DUCKDB_PATH=/data/beanflows/analytics.duckdb
|
|
volumes:
|
|
- app-data:/app/data
|
|
- /data/beanflows:/data/beanflows:ro
|
|
networks:
|
|
- net
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/health')"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
green-worker:
|
|
profiles: ["green"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
command: python -m beanflows.worker
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
volumes:
|
|
- app-data:/app/data
|
|
networks:
|
|
- net
|
|
|
|
green-scheduler:
|
|
profiles: ["green"]
|
|
build:
|
|
context: .
|
|
restart: unless-stopped
|
|
command: python -m beanflows.worker scheduler
|
|
env_file: ./.env
|
|
environment:
|
|
- DATABASE_PATH=/app/data/app.db
|
|
volumes:
|
|
- app-data:/app/data
|
|
networks:
|
|
- net
|
|
|
|
volumes:
|
|
app-data:
|
|
|
|
networks:
|
|
net:
|