Files

29 lines
1.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# sultan agent auf einem Docker-Host (Backend).
#
# cp .env.example .env && $EDITOR .env # SULTAN_TOKEN, DOCKER_GID
# install -d -m 0700 -o 65532 -g 65532 suldata
# docker compose up -d
#
# network_mode: host ist Absicht:
# - Backend-Adresse: der Agent meldet die Host-IP (Route zum Server bzw.
# --backend-interface=wt0), nicht die Container-IP aus dem Bridge-Netz.
# - Knoten-ID: Default ist der Hostname – mit Host-Netz der des Hosts statt
# der zufälligen Container-ID.
services:
sultan-agent:
image: ${SULTAN_IMAGE:-sultan:latest}
container_name: sultan-agent
restart: unless-stopped
network_mode: host
command: ["sultan", "agent", "--data-dir=/suldata", "--config-dir=none"]
# Alle Einstellungen kommen aus .env (Vorlage mit Defaults: .env.example).
env_file: .env
# Lesezugriff auf den Docker-Socket für den nonroot-User (UID 65532).
group_add:
- "${DOCKER_GID:?DOCKER_GID setzen: getent group docker | cut -d: -f3}"
volumes:
# :ro schützt nur die Socket-Datei, nicht die API – der Agent nutzt
# ausschließlich lesende Aufrufe (Container-Liste, Events).
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./suldata:/suldata # node.key (0600) und node.json – persistent halten!