Skip to content

Deployment

Aleksandr Artamokhov edited this page Jun 26, 2026 · 1 revision

Deployment

Docker Compose (default)

cp -n .env.example .env
docker compose up -d --build

Persistent state: host directory ./data/app/data (products, pipeline DB, secrets, LLM logs).

Production script

scripts/deploy.sh:

./scripts/deploy.sh --public-url https://magic-ai-factory.com

For magic-ai-factory.com, ensure .env contains AIFACTORY_DEMO_READONLY=1 (append-only via fill_production_env.py when using --public-url, or set manually). See Public-Demo.

Uses scripts/fill_production_env.py to append only missing keys:

  • NEXT_PUBLIC_SITE_URL, AIFACTORY_CORS_ORIGINS
  • AIFACTORY_FIREWALL_RULES_FERNET_KEY (when possible)
  • AIFACTORY_SANDBOX_PREVIEW_NETWORK_ISOLATION=1 default

Then docker compose build + up -d app.

Public hostname (this fleet)

Production: magic-ai-factory.com — nginx → Compose 9080.

Full notes: docs/production-domain.md

Full ecosystem redeploy

Factory + Hub + Mesh + Alien Monitor — always from repo root, fixed order:

./scripts/deploy_ecosystem.sh
Step Script
Factory ./scripts/deploy.sh
Hub ./scripts/deploy_hub.sh
Mesh ./scripts/deploy_mesh.sh
Monitor ./scripts/deploy_alien_monitor.sh
Verify ./scripts/verify_ecosystem_full.sh (included in deploy_ecosystem unless --skip-verify)

Hub: do not redeploy with cd aimarket-hub && docker compose up — wrong build context; use deploy_hub.sh only. Details: docs/deploy-ecosystem.md.

AIMarket Hub — modelmarket.dev (TLS)

Federation hub on https://modelmarket.dev (nginx :443 → Docker hub 127.0.0.1:9083).

Hub container (redeploy):

./scripts/deploy_hub.sh

TLS bootstrap:

sudo CERTBOT_EMAIL=you@example.com ./scripts/setup-modelmarket-ssl.sh

Or: docs/production-modelmarket-dev.md — certbot + certbot.timer auto-renewal.

DNS: modelmarket.dev and www → same host as the factory.

Static storefront deploy (optional)

After DevOps stage: Vercel / Netlify / Cloudflare Pages tokens in .env and data/state/.../auto_publish.json.

Guide: docs/auto-publish.md

Full-stack cloud backends

Railway / Fly / Cloud Run layout for full_software products:

docs/deploy-full-software-cloud.md

Configuration layers

YAML fragments + admin overlay — see docs/configuration.md and wiki Documentation-Index.

Health check

curl -s http://127.0.0.1:9081/api/health
docker compose ps app

Entrypoint watchdog restarts uvicorn on zombie/dead health failures.

Clone this wiki locally