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
All-in-One
Single Docker container with everything bundled — simplest path to a running instance
Docker Compose
Multi-container deployment with individual scaling and production profiles
Gitea Integration
Self-hosted Git repository management for workflows and configurations
Comparison
| All-in-One | Docker Compose | |
|---|---|---|
| Containers | 1 | 3+ (API, frontend, m3-plugin-runner, traefik) |
| Best for | Demos, evaluation, small teams | Production, development, scaling |
| Scaling | Vertical only | Individual service scaling |
| Hot reload | No | Yes (dev profile) |
| Process management | supervisord | Docker orchestration |
| Reverse proxy | nginx (embedded) | Traefik (with dashboard) |
| Build targets | allinone, prod | Individual 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=MARIESECRETACCESSKEYStandalone 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 .envRequired:
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://user:pass@host:5432/db |
S3_ENDPOINT_URL | S3-compatible endpoint | http://localhost:9000 |
S3_ACCESS_KEY_ID | S3 access key | MARIEACCESSKEY |
S3_SECRET_ACCESS_KEY | S3 secret key | MARIESECRETACCESSKEY |
JWT_ACCESS_SECRET | JWT signing secret | Generate with openssl rand -hex 32 |
JWT_REFRESH_SECRET | JWT refresh secret | Generate with openssl rand -hex 32 |
Optional:
| Variable | Default | Description |
|---|---|---|
S3_BUCKET_NAME | marie | S3 bucket name |
S3_REGION | us-east-1 | S3 region |
WEBAPP_DOMAIN | apps.localhost | Domain for webapp subdomains |
RUNNER_API_KEY | (none) | API key for m3-plugin-runner auth |
PORT | 3500 | API 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.prismaArchitecture
