Add grafana docker network and restrict port binds

This commit is contained in:
Jake Howard 2021-03-04 14:39:40 +00:00
parent 155bc837a8
commit fe2450d43b
Signed by: jake
GPG key ID: 57AFB45680EDD477
5 changed files with 24 additions and 5 deletions

View file

@ -1,6 +1,7 @@
collections: collections:
- ansible.posix - ansible.posix
- community.general - community.general
- community.docker
roles: roles:
- src: geerlingguy.docker - src: geerlingguy.docker

View file

@ -1 +1,3 @@
expose_ssh: true expose_ssh: true
protected_ip: "{{ pve_hosts.forrest.internal_ip }}"

View file

@ -17,12 +17,14 @@ services:
- GF_SMTP_PASSWORD={{ grafana_smtp_password }} - GF_SMTP_PASSWORD={{ grafana_smtp_password }}
- GF_SMTP_FROM_ADDRESS={{ grafana_from_email }} - GF_SMTP_FROM_ADDRESS={{ grafana_from_email }}
- GF_SMTP_FROM_NAME=grafana - GF_SMTP_FROM_NAME=grafana
volumes: volumes:
- "{{ app_data_dir }}/grafana:/var/lib/grafana" - "{{ app_data_dir }}/grafana:/var/lib/grafana"
networks:
- default
- grafana
restart: unless-stopped restart: unless-stopped
ports: ports:
- 3000:3000 - "{{ protected_ip }}:3000:3000"
depends_on: depends_on:
- db - db
- renderer - renderer
@ -41,3 +43,8 @@ services:
restart: unless-stopped restart: unless-stopped
environment: environment:
- BROWSER_TZ={{ TZ }} - BROWSER_TZ={{ TZ }}
networks:
grafana:
external: true

View file

@ -8,8 +8,9 @@ services:
- /mnt/tank/dbs/influx/forrest:/var/lib/influxdb - /mnt/tank/dbs/influx/forrest:/var/lib/influxdb
environment: environment:
- INFLUXDB_HTTP_AUTH_ENABLED=true - INFLUXDB_HTTP_AUTH_ENABLED=true
ports: networks:
- 8086:8086 - default
- grafana
chronograf: chronograf:
image: chronograf:1.8-alpine image: chronograf:1.8-alpine
@ -21,4 +22,8 @@ services:
volumes: volumes:
- ./chronograf:/var/lib/chronograf - ./chronograf:/var/lib/chronograf
ports: ports:
- 8888:8888 - "{{ protected_ip }}:8888:8888"
networks:
grafana:
external: true

View file

@ -1,3 +1,7 @@
- name: Create network
docker_network:
name: grafana
- name: Create grafana install directory - name: Create grafana install directory
file: file:
path: /opt/grafana path: /opt/grafana