# The project name and the volume name are load-bearing. # # `name: mikrodash` + `volumes: data` is what produces the volume `mikrodash_data`, # which holds every history sample, alert row and audit row this install has ever # written, plus the encrypted settings and the user store. Renaming either would # silently start a brand new empty volume and look like total data loss. name: mikrodash services: mikrodash: build: . # NAMED FOR THE PRODUCT, not the language. Both were `mikrodash-go` only to # tell them apart from the Node image and container during coexistence, and # that ended at the v0.8.0 cutover. # # The local name had also drifted from the PUBLISHED one, which has always # been `ghcr.io/secops-7/mikrodash` — see .github/workflows/docker-publish.yml. # These now agree. # # The compose PROJECT name above stays `mikrodash`, so the data volume is # still `mikrodash_data` and neither rename can orphan it. image: mikrodash container_name: MikroDash ports: - "3081:3081" # ZERO-TOUCH PROVISIONING'S WIREGUARD. Nothing listens until it is switched # on (Settings, Provisioning), and it is userspace, so the container needs # no NET_ADMIN and no /dev/net/tun. Remote routers dial it, so it must be # reachable from the internet (forwarded on your firewall) to be useful. # # IT MUST MATCH "Listen port" IN SETTINGS, and the failure when it does not # is silent: MikroDash binds the port from the SETTING inside the # container, Docker publishes the one named here, and a mismatch leaves # every handshake arriving at a port nothing is listening on. The tunnel # logs "tunnel up" either way. Set ZTP_PORT in .env and the two follow each # other; the default is the default in Settings. - "${ZTP_PORT:-13231}:${ZTP_PORT:-13231}/udp" volumes: - data:/data restart: unless-stopped environment: # ONLY AFFECTS WHAT THE LOG LINES SAY. Scheduling does not read this: a # backup or report time is resolved through the `displayTimezone` SETTING, # and backup filenames are stamped UTC by `StemFor` on purpose, because a # local stem repeats itself for an hour every autumn. So this is a # readability control and changing it cannot move a schedule or age a file # differently. # # Passed through rather than hard-coded, and defaulted to UTC, so the # committed file carries nobody's location. Set TZ in a local .env (which # is gitignored) to read the logs in your own time. - TZ=${TZ:-UTC} # ── BEHIND A REVERSE PROXY, SET THIS ────────────────────────────────── # # The WebSocket handshake is refused unless the browser's Origin matches # the Host this process sees. A proxy makes those differ by definition — # the browser says `dash.example.com`, the proxy forwards to # `mikrodash:3081` — so a proxied install cannot open a socket and the log # reads "request Origin ... is not authorized for Host ...". Issue #128. # # List the host(s) the BROWSER uses, comma separated, with the port when # it is not the default: `dash.example.com` or `10.0.0.5:8443`. Wildcards # work: `*.example.com`. # # EMPTY IS SAME-ORIGIN ONLY, and that is the right default: this check is # what stops a hostile page opening an authenticated socket to a MikroDash # you are signed in to. `X-Forwarded-Host` is deliberately NOT trusted, # because any client can send one. - MIKRODASH_ORIGINS=${MIKRODASH_ORIGINS:-} # Behind a reverse proxy or a cloudflared sidecar, the address range of that # proxy (IPs or CIDRs, comma separated). Its X-Forwarded-For is then believed, # so the login limit and the audit trail see visitors rather than the proxy. # Empty trusts nobody, which is right when browsers connect directly. # Issue #111. - MIKRODASH_TRUSTED_PROXIES=${MIKRODASH_TRUSTED_PROXIES:-} # Which router addresses may be connected to: private (empty means this: # the LAN, VPNs, Tailscale and the internet, never loopback or link-local), # public (the internet only) or any (also loopback, for a tunnel on this # machine). A router's stored password goes to whatever it names, so this # is a deployment setting, not a Settings field. GHSA-mcwr-rm79-fr4h. - MIKRODASH_ROUTER_ADDRESSES=${MIKRODASH_ROUTER_ADDRESSES:-} # Command-rate instrument for the collectors rewrite. Empty = off. - MIKRODASH_CMD_STATS=${MIKRODASH_CMD_STATS:-} # The flags are baked into the image's CMD; they are repeated here so the # deployed configuration is readable without inspecting the image. command: - -listen=:3081 - -data=/data - -web=/app/web/dist - -static=/app/web/public - -history - -backup-scheduler - -retention - -alert-dispatch healthcheck: test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3081/healthz"] interval: 30s timeout: 5s retries: 5 start_period: 20s logging: driver: json-file options: max-size: "10m" max-file: "3" volumes: data: