Skip to content

Docker

mik is available as a minimal Docker image (~49MB) for containerized deployments.

Terminal window
# Pull the image
docker pull ghcr.io/dufeutech/mik
# Run with volume mount
docker run -v $(pwd):/app -p 3000:3000 ghcr.io/dufeutech/mik

Mount your project directory to /app:

my-project/
├── mik.toml # Configuration
├── modules/ # WASM handlers
│ ├── api.wasm
│ └── auth.wasm
└── scripts/ # Optional: JS orchestration
└── router.js
docker-compose.yml
services:
mik:
image: ghcr.io/dufeutech/mik:latest
ports:
- "3000:3000"
volumes:
- ./:/app
environment:
- RUST_LOG=info
services:
mik:
image: ghcr.io/dufeutech/mik:latest
ports:
- "3000:3000"
volumes:
- ./:/app
environment:
- RUST_LOG=info
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686" # UI
- "4317:4317" # OTLP gRPC

With mik.toml:

[project]
name = "my-service"
[server]
port = 3000
modules = "modules/"
[tracing]
enabled = true
otlp_endpoint = "http://jaeger:4317"
services:
mik:
image: ghcr.io/dufeutech/mik:latest
ports:
- "3000:3000"
volumes:
- ./modules:/app/modules:ro
- ./mik.toml:/app/mik.toml:ro
environment:
- RUST_LOG=info
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
healthcheck:
test: ["CMD", "/mik", "run", "--help"]
interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
services:
caddy:
image: caddy:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
depends_on:
- mik
mik:
image: ghcr.io/dufeutech/mik:latest
volumes:
- ./:/app
expose:
- "3000"
volumes:
caddy_data:

With Caddyfile:

example.com {
reverse_proxy mik:3000
}
VariableDefaultDescription
PORT3000Server port
RUST_LOGinfoLog level (debug, info, warn, error)
HOST0.0.0.0Bind address

The Docker image:

  • Base: scratch (minimal, no shell)
  • Size: ~49MB
  • TLS: rustls (pure Rust, no OpenSSL)
  • Features: Full runtime + OTLP tracing
  • Disabled: Registry features (use volume mounts instead)

To include your modules in the image:

FROM ghcr.io/dufeutech/mik:latest
COPY mik.toml /app/mik.toml
COPY modules/ /app/modules/

Build and run:

Terminal window
docker build -t my-service .
docker run -p 3000:3000 my-service

The /health endpoint returns service status:

Terminal window
curl http://localhost:3000/health
{
"status": "ready",
"cache_size": 2,
"cache_capacity": 100
}

Check that mik.toml exists and modules/ contains .wasm files:

Terminal window
docker run --rm -v $(pwd):/app --entrypoint="" ghcr.io/dufeutech/mik:latest /mik run

Ensure the module path in requests matches the filename:

  • modules/api.wasm/run/api/*
  • modules/auth.wasm/run/auth/*

On Linux, ensure mounted files are readable:

Terminal window
chmod -R 644 modules/*.wasm
chmod 644 mik.toml