-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
78 lines (70 loc) · 2.72 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: '2.1'
services:
#
# Welcome to Grafolean SNMP bot!
#
# This file should be modified to suit your running environment. Please check the comments and change
# the settings appropriately.
#
snmpbot:
# If you wish to load an explicit version, change the next line. For example:
# image: grafolean/grafolean-snmp-bot:v1.0.0
image: grafolean/grafolean-snmp-bot
container_name: grafolean-snmp-bot
build:
context: .
dockerfile: Dockerfile
environment:
# Backend url must be set to the address of the Grafolean backend, for example this uses Grafolean hosted service:
# - BACKEND_URL=https://grafolean.com/api
# IMPORTANT: '127.0.0.1' and 'localhost' are _never_ correct addresses for Grafolean backend, because they translate
# to container, not host.
- BACKEND_URL=${BACKEND_URL}
# To use SNMP bot, a bot with the protocol "snmp" must be added via user interface, then the token needs to be copied here:
- BOT_TOKEN=${BOT_TOKEN}
# Interval between fetching information about jobs:
- JOBS_REFRESH_INTERVAL=${JOBS_REFRESH_INTERVAL:-60}
- DB_HOST=db
- DB_DATABASE=${DB_NAME:-grafolean}
- DB_USERNAME=${DB_USER:-admin}
- DB_PASSWORD=${DB_PASS:-admin}
restart: always
networks:
- grafolean
db:
image: timescale/timescaledb:latest-pg12
container_name: grafolean-snmp-db
volumes:
# You should always save DB data to a host directory unless you are prepared to lose it. By default
# this the location of data is '/grafolean/db/'.
# Note that if you ever wish to copy this directory as backup, you need to stop grafolean
# container first. For alternative backup approaches consult PostgreSQL documentation.
- ${DB_DIR:-/grafolean/snmp-db/}:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=${DB_NAME:-grafolean}
- POSTGRES_USER=${DB_USER:-admin}
- POSTGRES_PASSWORD=${DB_PASS:-admin}
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -h db -U ${DB_USER:-admin} -t 1 -q"]
interval: 10s
timeout: 5s
retries: 3
networks:
- grafolean
# autoheal:
# # This container automatically restarts any container that fails its health check. Not a bullet-proof solution, but better than nothing.
# image: willfarrell/autoheal
# container_name: grafolean-snmp-bot-autoheal
# environment:
# - AUTOHEAL_CONTAINER_LABEL=all
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# restart: always
# networks:
# - grafolean
# If running on the same host, join the Grafolean network, so we can reach Grafolean
# backend at address grafolean:80.
networks:
grafolean:
name: grafolean