Docker Image
Motia provides official Docker images built with security and performance in mind:- Base: Distroless (gcr.io/distroless/cc-debian12:nonroot)
- Runtime: Non-root user execution
- Size: Minimal attack surface (no shell, no package manager)
- Registry:
iiidev/iii:latest
Pull the Image
Run Container
Basic run command:Exposed Ports
The Dockerfile exposes four ports:| Port | Service | Description |
|---|---|---|
| 49134 | WebSocket | Worker connections |
| 3111 | REST API | HTTP endpoints for registered functions |
| 3112 | Stream API | Real-time state synchronization |
| 9464 | Metrics | Prometheus metrics endpoint |
Docker Compose
Development Stack
Thedocker-compose.yml includes the full development stack with Redis and RabbitMQ:
Start the Stack
View Logs
Stop the Stack
Production Stack with Caddy
Thedocker-compose.prod.yml includes Caddy as a reverse proxy with automatic HTTPS:
Caddyfile Configuration
Create aCaddyfile for reverse proxy setup:
Start Production Stack
Building from Source
Production Image
The Dockerfile uses multi-stage builds with cargo-chef for optimized layer caching:Build Locally
Build Debug Image
For debugging with shell access:Volume Mounts
Configuration
Mount your config file as read-only:Data Persistence
For file-based KV stores, mount a data directory:Environment Variables
Logging
Configuration Expansion
The engine supports environment variable expansion in config files:Security Hardening
For production deployments, use security options:Next Steps
Production Setup
Security hardening and scaling strategies
Configuration
Configure modules and environment variables