Deployment
This page covers practical deployment patterns from local Docker runs to production hosts.
Recommended default: Docker Compose
bash
docker compose up --build -dCompose service (from repository):
yaml
services:
modbus-mqtt-bridge:
image: ghcr.io/tobiaswaelde/modbus-mqtt-bridge:latest
container_name: modbus-mqtt-bridge
restart: unless-stopped
volumes:
- ./config:/app/config:ro
command: ["--config", "/app/config/config.yml"]Why this is the default:
- reproducible setup across environments
- host-mounted config for easy updates
- built-in healthcheck in container image
Direct image deployment (GHCR)
bash
docker pull ghcr.io/tobiaswaelde/modbus-mqtt-bridge:latestbash
docker run --rm \
--name modbus-mqtt-bridge \
-v "$(pwd)/config:/app/config:ro" \
ghcr.io/tobiaswaelde/modbus-mqtt-bridge:latest \
--config /app/config/config.ymlBinary deployment (no container runtime)
bash
cargo build --release
./target/release/modbus-mqtt-bridge --config config/config.ymlUse this when you prefer host-level service management (systemd, supervisord, etc.).
Runtime checks
Manual healthcheck command:
bash
modbus-mqtt-bridge --healthcheck --config config/config.ymlRecommended operational checks:
- config file exists and parses (
.yml/.yaml/.json) - MQTT DNS/TCP reachability from runtime host
- writable points subscribe to
.../setas expected
Upgrade flow
- Pull new image tag (or build new binary).
- Keep
config/config.ymlstable and versioned. - Restart the service.
- Confirm healthcheck and MQTT message flow.
Production notes
- Set
logging.json: truefor structured log pipelines. - Prefer explicit version tags over
latestin controlled environments. - Back up your config repository and change history.