Docker
Deploy Motia applications using Docker containers
Docker is the foundation for all Motia production deployments. This guide covers containerizing your Motia app with the iii engine for local testing and production use.
Build Your Project
Before creating a Docker image, build your Motia project:
This produces optimized production files:
Dockerfile
Create a Dockerfile in your project root. This uses a multi-stage build to install the iii engine binary and run your Motia app with Bun:
.dockerignore
Create a .dockerignore to keep the image small:
Production config.yaml
Create a config-production.yaml that uses Redis adapters for production:
Docker Compose
For local development with Redis:
Run with:
Python Steps
Make sure you have the pyproject.toml at your project and the steps folder
Include this dockerfile
Add a second ExecModule entry in your config-production.yaml for the Python runtime:
Ports
| Port | Service |
|---|---|
3111 | REST API (HTTP endpoints) |
3112 | Stream API (WebSocket) |