stability-agent had no USER instruction and no user: in compose, running as root and writing root-owned files to /opt/homelab bind-mount. - Dockerfile: add useradd -m -u 1000 homelab + USER homelab - docker-compose.yml: add user: "1000:1000" and group_add: ["999"] (GID 999 = docker group on VPS) to retain docker.sock:ro access Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
977 B
YAML
32 lines
977 B
YAML
services:
|
|
stability-agent:
|
|
build: .
|
|
container_name: stability-agent
|
|
user: "1000:1000"
|
|
group_add:
|
|
- "999"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- /opt/homelab:/opt/homelab
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- /var/run/tailscale/tailscaled.sock:/var/run/tailscale/tailscaled.sock:ro
|
|
environment:
|
|
- STABILITY_CHECK_INTERVAL=${STABILITY_CHECK_INTERVAL:-60}
|
|
- DISK_THRESHOLD_PCT=${DISK_THRESHOLD_PCT:-90}
|
|
- MQTT_HOST=${MQTT_HOST}
|
|
- MQTT_PORT=${MQTT_PORT:-1883}
|
|
- REDIS_HOST=${REDIS_HOST:-100.108.208.3}
|
|
- REDIS_PORT=${REDIS_PORT:-6379}
|
|
- REDIS_ENABLED=${REDIS_ENABLED:-true}
|
|
- NODE_NAME=${NODE_NAME:-chelsty}
|
|
healthcheck:
|
|
test: ["CMD", "/bin/sh", "/app/healthcheck.sh"]
|
|
interval: 1m
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
opt_homelab:
|
|
external: true
|
|
name: homelab_data # This might vary, but /opt/homelab mount is preferred as direct path.
|