# SPDX-FileCopyrightText: 2026 JustDNS contributors # SPDX-License-Identifier: AGPL-3.0-or-later # # The official JustDNS install. It bundles two containers: # # justdns — the resolver and web UI (the only thing exposed to the network). # updater — a tiny sidecar that performs one-click updates. It is the ONLY # container with the Docker socket, and it has no ports and no # inbound network: it just watches a request file on the shared data # volume, runs the pull/recreate the UI asks for, and then prunes old # images (keeping the new one and its predecessor). The DNS process # never touches the socket. # # First run: # cp .env.example .env # then edit JUSTDNS_IMAGE/JUSTDNS_TAG if needed # docker compose up -d # # After this, updates are one click in the dashboard (System page). The UI writes # the target version; the updater rewrites JUSTDNS_TAG in .env and recreates the # justdns service. The updater itself keeps running, so it can report progress. name: justdns services: justdns: image: ${JUSTDNS_IMAGE:-ghcr.io/bonderaustriaat/justdns}:${JUSTDNS_TAG:-latest} container_name: justdns restart: unless-stopped ports: - "53:53/udp" - "53:53/tcp" - "8080:8080/tcp" # Custom block page (off until enabled in the dashboard). Needed so a # blocked domain — or your own block-page hostname — actually reaches the # page instead of a refused connection. Tip: `network_mode: host` makes # these (and the LAN-IP detection) simplest, at the cost of container # network isolation. - "80:80/tcp" - "443:443/tcp" # Encrypted client DNS (off until enabled in the dashboard). - "853:853/tcp" - "8443:8443/tcp" volumes: - justdns-data:/data # The at-rest encryption key, in its own volume so a copied data volume # cannot also decrypt the secret files (accounts, config). Generated on # first boot. Keep a separate backup — losing it makes the sealed files # unreadable. - justdns-keys:/keys environment: # Where the data volume is mounted; the update request/status files live # under /update. Matches the image default, set here for clarity. JUSTDNS_DATA_DIR: /data # Where the at-rest master key lives (its own volume above). Matches the # image default, set here for clarity. JUSTDNS_SECRET_KEY_PATH: /keys/master.key # Persist devices, schedules and the audit trail on the data volume. JUSTDNS_CLIENTS_PATH: /data/clients.json JUSTDNS_SCHEDULES_PATH: /data/schedules.json JUSTDNS_AUDIT_PATH: /data/audit.log # Validate DNSSEC on upstream answers. JUSTDNS_DNSSEC: "true" # Prometheus scrape token — put JUSTDNS_METRICS_TOKEN=… in .env to enable # GET /metrics. Empty (the default) leaves the endpoint off (404). Passed # through on every update, so it survives a one-click update. JUSTDNS_METRICS_TOKEN: ${JUSTDNS_METRICS_TOKEN:-} # Which repository the UI checks for releases (public GitHub tags). The # image default already points here; override only for a fork. # JUSTDNS_UPDATE_REPO: bonderaustriaAT/JustDNS updater: image: ${JUSTDNS_UPDATER_IMAGE:-ghcr.io/bonderaustriaat/justdns-updater}:${JUSTDNS_UPDATER_TAG:-latest} container_name: justdns-updater restart: unless-stopped environment: # The image the sidecar pulls and recreates. Only the *version* ever comes # from the app; the repository is fixed here, so the app can never make the # sidecar pull or delete an arbitrary image. JUSTDNS_IMAGE: ${JUSTDNS_IMAGE:-ghcr.io/bonderaustriaat/justdns} JUSTDNS_SERVICE: justdns JUSTDNS_COMPOSE_FILE: /project/docker-compose.yml JUSTDNS_ENV_FILE: /project/.env JUSTDNS_DATA_DIR: /data # Must match this project's name so the recreate targets the running # container rather than spawning an orphan. COMPOSE_PROJECT_NAME: justdns volumes: - /var/run/docker.sock:/var/run/docker.sock - justdns-data:/data # The compose file + .env, so the sidecar can recreate the service and pin # the new tag. Mount the directory that holds this file. - ./:/project # --- Optional: DACH candidate harvester (read-only) ------------------------ # A companion that reads the query log over the API and writes ranked candidate # reports for the DACH blocklist. It is OFF by default — uncomment this service # (and the harvester-data volume below) to enable it. It blocks nothing and # changes nothing; its only output is reports under /data/harvester/reports. # # Prerequisites you must set up yourself: # - A read-only Viewer service account on JustDNS, with MFA disabled (this # flow has no second step). Give it the Viewer role and nothing more. # - Put its credentials in .env: HARVEST_USER / HARVEST_PASSWORD. # See crates/justdns-harvester/README.md for the selection test and all options. # # harvester: # image: ${JUSTDNS_HARVESTER_IMAGE:-ghcr.io/bonderaustriaat/justdns-harvester}:${JUSTDNS_HARVESTER_TAG:-latest} # container_name: justdns-harvester # restart: unless-stopped # depends_on: # - justdns # environment: # # The instance to read from. Over the compose network the service name # # resolves; 8080 is the web/API port. # JUSTDNS_URL: http://justdns:8080 # JUSTDNS_USER: ${HARVEST_USER:-} # JUSTDNS_PASSWORD: ${HARVEST_PASSWORD:-} # # Poll hourly; set HARVEST_ONCE=1 instead to run once and exit (cron style). # HARVEST_INTERVAL_SECS: "3600" # volumes: # # Its own volume, kept apart from justdns-data: it holds log-derived # # aggregates and the reports, not JustDNS's own state. # - harvester-data:/data volumes: # The name is pinned (no compose project prefix), so a fresh install creates # `justdns-data` and an existing `docker run` install (which used exactly this # name) is adopted with all its data intact rather than replaced by an empty # volume. justdns-data: name: justdns-data # The at-rest key volume, kept separate from the data on purpose. Pinned name so # it is created once and reused across one-click updates (which recreate the # service from this compose file, keeping the volume) rather than regenerated. justdns-keys: name: justdns-keys # Uncomment alongside the optional harvester service above. # harvester-data: # name: justdns-harvester-data