Skip to Content
DeploymentOverview

Deployment

M3 Forge provides multiple deployment options to suit various environments and use cases.

All deployment options require external PostgreSQL and S3-compatible storage services. When deployed alongside Marie-AI, these can be shared from the Marie-AI infrastructure stack.

Deployment Options

Comparison

All-in-OneDocker Compose
Containers13+ (API, frontend, m3-plugin-runner, traefik)
Best forDemos, evaluation, small teamsProduction, development, scaling
ScalingVertical onlyIndividual service scaling
Hot reloadNoYes (dev profile)
Process managementsupervisordDocker orchestration
Reverse proxynginx (embedded)Traefik (with dashboard)
Build targetsallinone, prodIndividual Dockerfiles

Prerequisites

All deployment options require:

  • Docker Engine 24.0+ and Docker Compose v2.20+
  • PostgreSQL 15+ with the following schemas: public, marie_scheduler, marie_studio
  • S3-compatible storage (AWS S3, MinIO, or any S3-compatible service)

Using Marie-AI Infrastructure

If you have the Marie-AI all-in-one stack running, you already have PostgreSQL and S3-compatible storage available:

# Marie-AI provides these services: # PostgreSQL: localhost:5432 (user: postgres) # S3 Storage: localhost:8000 (console at :8001)

Configure M3 Forge to point at the shared infrastructure:

DATABASE_URL=postgresql://postgres:123456@localhost:5432/studio S3_ENDPOINT_URL=http://localhost:8000 S3_ACCESS_KEY_ID=MARIEACCESSKEY S3_SECRET_ACCESS_KEY=MARIESECRETACCESSKEY

Standalone PostgreSQL + S3 Storage

If deploying M3 Forge independently, start external services first:

# PostgreSQL docker run -d --name postgres \ -p 5432:5432 \ -e POSTGRES_PASSWORD=mysecret \ -v pgdata:/var/lib/postgresql/data \ postgres:17 # S3-compatible storage (MinIO example) docker run -d --name minio \ -p 9000:9000 -p 9001:9001 \ -e MINIO_ROOT_USER=minioadmin \ -e MINIO_ROOT_PASSWORD=minioadmin \ -v miniodata:/data \ minio/minio server /data --console-address ":9001"

Environment Variables

All deployment methods share the same environment variables. Copy .env.example to .env and configure:

cp .env.example .env

Required:

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
S3_ENDPOINT_URLS3-compatible endpointhttp://localhost:9000
S3_ACCESS_KEY_IDS3 access keyMARIEACCESSKEY
S3_SECRET_ACCESS_KEYS3 secret keyMARIESECRETACCESSKEY
JWT_ACCESS_SECRETJWT signing secretGenerate with openssl rand -hex 32
JWT_REFRESH_SECRETJWT refresh secretGenerate with openssl rand -hex 32

Optional:

VariableDefaultDescription
S3_BUCKET_NAMEmarieS3 bucket name
S3_REGIONus-east-1S3 region
WEBAPP_DOMAINapps.localhostDomain for webapp subdomains
RUNNER_API_KEY(none)API key for m3-plugin-runner auth
PORT3500API server port

Database Migrations

All deployment options run Prisma migrations automatically on startup. To run manually:

# Inside the container npx prisma migrate deploy --schema packages/@marie/db/prisma/schema.prisma # Or via Docker exec docker exec m3-forge npx prisma migrate deploy \ --schema packages/@marie/db/prisma/schema.prisma

Architecture

M3 Forge deployment architecture showing API server, frontend, plugin runner, and external services
Last updated on