|
| 1 | +version: '2.1' |
| 2 | +services: |
| 3 | + |
| 4 | + # |
| 5 | + # Welcome to Grafolean NetFlow bot! |
| 6 | + # |
| 7 | + # This file should be modified to suit your running environment. Please check the comments and change |
| 8 | + # the settings appropriately. |
| 9 | + # |
| 10 | + |
| 11 | + netflowbot: |
| 12 | + # If you wish to load an explicit version, change the next line. For example: |
| 13 | + # image: grafolean/grafolean-netflow-bot:v1.0.0 |
| 14 | + image: grafolean/grafolean-netflow-bot |
| 15 | + container_name: grafolean-netflow-bot |
| 16 | + environment: |
| 17 | + # Backend url must be set to the address of the Grafolean backend, for example this uses Grafolean hosted service: |
| 18 | + # - BACKEND_URL=https://grafolean.com/api |
| 19 | + # IMPORTANT: '127.0.0.1' and 'localhost' are _never_ correct addresses for Grafolean backend, because they translate |
| 20 | + # to container, not host. |
| 21 | + - BACKEND_URL=${BACKEND_URL} |
| 22 | + # To use NetFlow bot, a bot with the protocol "netflow" must be added via user interface, then the token needs to be copied here: |
| 23 | + - BOT_TOKEN=${BOT_TOKEN} |
| 24 | + # Interval between fetching information about jobs: |
| 25 | + - JOBS_REFRESH_INTERVAL=${JOBS_REFRESH_INTERVAL:-60} |
| 26 | + - REDIS_HOST=redis |
| 27 | + restart: always |
| 28 | + networks: |
| 29 | + - grafolean |
| 30 | + |
| 31 | + |
| 32 | + redis: |
| 33 | + image: redis:5-alpine |
| 34 | + container_name: grafolean-netflow-bot-redis |
| 35 | + restart: always |
| 36 | + networks: |
| 37 | + - grafolean |
| 38 | + |
| 39 | + |
| 40 | + netflowcollector: |
| 41 | + # This process collects NetFlow data: |
| 42 | + image: grafolean/grafolean-netflow-bot |
| 43 | + container_name: grafolean-netflow-collector |
| 44 | + environment: |
| 45 | + - REDIS_HOST=redis |
| 46 | + - NETFLOW_PORT=2055 |
| 47 | + ports: |
| 48 | + - "${NETFLOW_PORT:-2055}:2055/udp" |
| 49 | + restart: always |
| 50 | + # CAREFUL: NetFlow collector uses the same docker image as bot |
| 51 | + # (grafolean/grafolean-netflow-bot), but specifies a different entrypoint: |
| 52 | + entrypoint: |
| 53 | + - python |
| 54 | + - -m |
| 55 | + - netflowcollector |
| 56 | + networks: |
| 57 | + - grafolean |
| 58 | + |
| 59 | + |
| 60 | + autoheal: |
| 61 | + # This container automatically restarts any container that fails its health check. Not a bullet-proof solution, but better than nothing. |
| 62 | + image: willfarrell/autoheal |
| 63 | + container_name: grafolean-netflow-bot-autoheal |
| 64 | + environment: |
| 65 | + - AUTOHEAL_CONTAINER_LABEL=all |
| 66 | + volumes: |
| 67 | + - /var/run/docker.sock:/var/run/docker.sock |
| 68 | + restart: always |
| 69 | + networks: |
| 70 | + - grafolean |
| 71 | + |
| 72 | + |
| 73 | +# If running on the same host, join the Grafolean network, so we can reach Grafolean |
| 74 | +# backend at address grafolean:80. |
| 75 | +networks: |
| 76 | + grafolean: |
| 77 | + name: grafolean |
0 commit comments