From eaec49927b072d2091c190a2062d33fe914e8c07 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:35:30 -0600 Subject: [PATCH] added watchtower and portainer --- README.md | 14 ++++++++------ docker-compose.yml | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 90732db..e1ee3a7 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,14 @@ Various tools to monitor Docker containers ## Environment Variables -- `DOCKER_INFLUXDB_INIT_ORG` - - Designates the InfluxDB organization in `telegraf.conf` -- `INFLUX_WRITE_TOKEN` - - Designates the write token for InfluxDB in `telegraf.conf` -- `INFLUX_HOST` (optional) -- `LOKI_HOST` (optional) +| Environment Variable | Description | +| -------------------------- | ----------------------------------------------- | +| `HOSTNAME` | Hostname for identifying log lines | +| `DOCKER_GUID` | Group ID number for the `docker` user group | +| `DOCKER_INFLUXDB_INIT_ORG` | Organization name for InfluxDB | +| `INFLUX_WRITE_TOKEN` | InfluxDB write token | +| `INFLUX_HOST` | Hostname or IP address of the InfluxDB instance | +| `LOKI_HOST` | Hostname or IP address of the Loki instance | ## Setup diff --git a/docker-compose.yml b/docker-compose.yml index c52cd1a..2874aca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,15 @@ version: '3.9' services: + portainer-agent: + image: portainer/agent + container_name: portainer_agent + restart: always + ports: + - 9001:9001 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker/volumes:/var/lib/docker/volumes + telegraf-docker: image: telegraf restart: unless-stopped @@ -24,3 +34,12 @@ services: command: - "-config.file=/etc/promtail/promtail-config.yml" - "-config.expand-env=true" + + watchtower: + image: containrrr/watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + WATCHTOWER_SCHEDULE: "0 3 * * *"