moirad configuration
moirad is configured with environment variables only.
| Variable | Default | Meaning |
|---|---|---|
DEPLOY_DIR |
required | Absolute path of the deploy folder, the same inside and outside the container |
MOIRAD_URL |
required | URL clients use, put in invites (https://192.0.2.10:7443). Its host goes into the certificate SAN |
MOIRAD_HOST |
hostname | Host name shown to clients and used as the target prefix |
MOIRAD_LISTEN |
:7443 |
Listen address inside the container |
MOIRAD_STATE_DIR |
$DEPLOY_DIR/moirad |
State directory |
MOIRAD_HELPER_IMAGE |
the running image | Local image for the self-update helper |
MOIRAD_SELF_CONTAINER |
auto-detected | The daemon’s own container name. An invalid name prevents startup |
MOIRAD_LOG_LEVEL |
info |
debug, info, warn or error |
Mounts
Section titled “Mounts”| Mount | Why |
|---|---|
/var/run/docker.sock |
Engine API access |
<DEPLOY_DIR> at the same path |
Compose resolves relative paths and env files inside the container, the Docker daemon opens them on the host |
/root/.docker/config.json (read-only) |
Registry logins for update. Inline auths only, no credsStore or credHelpers |
| What | Where | Survives restart |
|---|---|---|
| TLS key and certificate (ECDSA P-256, self-signed, 10 years) | tls/key.pem, tls/cert.pem |
yes |
| Enrolled clients: name, token SHA-256, created and last seen | clients.json |
yes |
| Pending invites (single use, 15 minutes) | memory | no |
| Jobs, output buffers, locks, Compose model cache | memory | no |
| Self-update helper locks | Docker container labels | while the helper runs |
| Env backups | <DEPLOY_DIR>/<stack>/.history/ |
yes |
At startup the daemon enforces mode 0700 on the state directory and 0600 on clients.json
and tls/key.pem, and refuses to read either through a symlink.
Admin commands
Section titled “Admin commands”docker exec moirad moirad invite [--name <client>]docker exec moirad moirad clients lsdocker exec moirad moirad clients revoke <client>docker exec moirad moirad tls fingerprintThey talk to the running daemon over /run/moirad/admin.sock (mode 600) inside the container.
See Clients and access.
moirad logs structured lines with log/slog. Job starts and ends carry job, client,
stack, service, action and exit. Env values are never logged.
docker logs -f moiradThe image
Section titled “The image”The image is docker:<pinned>-cli (Alpine with the Docker CLI) plus the static moirad binary
and a pinned, checksum-verified Compose release, so every host runs the same Compose version
regardless of what is installed on the host. It targets Linux amd64 and stays under 150 MB.
Resource use
Section titled “Resource use”- Idle RSS under 30 MB, typically 10–20 MB. Idle CPU close to zero: there is no polling, and drift is computed only on request.
- Compose processes exist only while a request or job needs one.
- At startup the daemon loads every stack’s Compose model in the background, up to eight at a
time, so the first
moira lsis fast.