Skip to content

Docker

Run Miravo in Docker with multi-arch images, Docker Compose examples, environment variables, volume mounts, health probes, and Kubernetes readiness checks.

Miravo publishes multi-arch Docker images for linux/amd64 and linux/arm64.

RegistryImage
Docker Hubamineamaach/miravo:latest
GitHub Container Registryghcr.io/amine-amaach/miravo:latest

Pin a version tag: amineamaach/miravo:0.3.0

Terminal window
docker run --rm -p 1883:1883 -p 8080:8080 amineamaach/miravo:latest

With a specific template:

Terminal window
docker run --rm -p 1883:1883 -p 8080:8080 \
amineamaach/miravo:latest start --template water-treatment

With OPC UA:

Terminal window
docker run --rm -p 1883:1883 -p 4840:4840 -p 8080:8080 \
amineamaach/miravo:latest start --template smart-factory --opcua
services:
miravo:
image: amineamaach/miravo:latest
init: true
command: ["--log-format", "json", "start"]
environment:
MIRAVO_ADMIN_HOST: 0.0.0.0
MIRAVO_ADMIN_PORT: 8080
ports:
- "1883:1883"
- "8080:8080"
read_only: true
tmpfs:
- /tmp:size=256m
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
stop_grace_period: 30s
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/healthz > /dev/null || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
restart: "on-failure:5"
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
deploy:
resources:
limits:
cpus: "4"
memory: 4G
PortProtocolDescription
1883MQTTEmbedded broker (when MQTT enabled)
4840OPC UAOPC UA server (when --opcua enabled)
8080HTTPAdmin API and web console

Set any MIRAVO_* variable in environment:

environment:
MIRAVO_ADMIN_HOST: 0.0.0.0
MIRAVO_ADMIN_PORT: 8080
MIRAVO_MQTT_PORT: 1883
MIRAVO_NAME: my-simulation
MIRAVO_TEMPLATE: water-treatment

See Environment Variables for the full reference.

Mount custom models or templates into the container:

volumes:
- ./my-models:/app/custom-models:ro
command: ["start", "--template", "/app/custom-models/my-plant.miravo.yaml"]

Or use the local registry:

volumes:
- ./miravo-data:/data/miravo
environment:
MIRAVO_HOME: /data/miravo

The container includes a built-in health check:

EndpointUseHealthy
GET /healthzLiveness probeEngine running, tick loop progressing
GET /readyzReadiness probeEngine running + all enabled adapters connected

Kubernetes example:

livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 20
periodSeconds: 30
readinessProbe:
httpGet:
path: /readyz
port: 8080
initialDelaySeconds: 20
periodSeconds: 10

The default image runs as a non-root user (miravo, UID 10001). The Compose profile adds:

  • read_only: true — Read-only root filesystem
  • cap_drop: ALL — Drop all Linux capabilities
  • no-new-privileges — Prevent privilege escalation
  • tmpfs at /tmp for runtime scratch space