28 lines
1.4 KiB
YAML
28 lines
1.4 KiB
YAML
services:
|
|
roborock-server:
|
|
image: ghcr.io/python-roborock/local_roborock_server:latest
|
|
container_name: roborock_local_server
|
|
restart: unless-stopped
|
|
environment:
|
|
- ROBOROCK_FQDN=${ROBOROCK_FQDN:-roborock.local}
|
|
- ROBOROCK_REGION=${ROBOROCK_REGION:-de}
|
|
- ROBOROCK_ADMIN_PASSWORD=${ROBOROCK_ADMIN_PASSWORD:-SicheresPasswort123!}
|
|
- ROBOROCK_SERVER_HEALTHCHECK_SCHEME=http
|
|
ports:
|
|
- "${ROBOROCK_PROXY_PORT:-8080}:8080"
|
|
- "${ROBOROCK_MQTT_PORT:-1883}:1883"
|
|
- "${ROBOROCK_MQTT_TLS_PORT:-8883}:8883"
|
|
volumes:
|
|
# Wird von Portainer aus dem Git geklont und steht sofort bereit
|
|
- ./config.toml.template:/app/config.toml.template:ro
|
|
# Pfad zur DB. Damit Portainer keinen Ordner erstellt, legen wir die Datei im Command an:
|
|
- ${ROBOROCK_DB_FILE:-./roborock.db}:/data/roborock.db
|
|
# Erweitertes Skript: 1. Erstellt eine leere DB-Datei falls nicht existent -> 2. Befüllt die config.toml -> 3. Startet die App
|
|
command: >
|
|
bash -c "touch /data/roborock.db && python3 -c \"import os, string; t = string.Template(open('/app/config.toml.template').read()); open('/app/config.toml', 'w').write(t.substitute(os.environ))\" && exec python3 -m local_roborock_server"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|