Merge pull request 'Configuration de Grafana' (#14) from grafana into main
Reviewed-on: https://git.weko.io/resilien/services/pulls/14
This commit is contained in:
commit
c6821a547f
43
grafana/.env
43
grafana/.env
|
@ -1,3 +1,44 @@
|
||||||
|
########
|
||||||
|
# DOCKER
|
||||||
|
|
||||||
|
#DOCKER_CONTEXT=
|
||||||
|
#DOCKER_HOST=
|
||||||
|
SERVICES_DIR=..
|
||||||
|
COMPOSE_FILE=${SERVICES_DIR}/grafana/docker-compose.yml:${SERVICES_DIR}/grafana/docker-compose.traefik.yml
|
||||||
|
#COMPOSE_PROJECT_NAME=
|
||||||
|
|
||||||
|
#########
|
||||||
|
# GRAFANA
|
||||||
|
|
||||||
GRAFANA_DOMAIN=grafana.cool.life
|
GRAFANA_DOMAIN=grafana.cool.life
|
||||||
|
#GRAFANA_VOLUME_NAME=
|
||||||
|
#GRAFANA_CONTAINER_NAME=
|
||||||
|
#GRAFANA_IMAGE=
|
||||||
|
|
||||||
GF_SECURITY_ADMIN_USER=admin
|
GF_SECURITY_ADMIN_USER=admin
|
||||||
GF_SECURITY_ADMIN_PASSWORD=admin
|
GF_SECURITY_ADMIN_PASSWORD=password
|
||||||
|
#GF_SECURITY_DISABLE_GRAVATAR=
|
||||||
|
#GF_SECURITY_COOKIE_SECURE=
|
||||||
|
#GF_USERS_ALLOW_SIGN_UP=
|
||||||
|
GF_INSTALL_PLUGINS=grafana-piechart-panel
|
||||||
|
|
||||||
|
######
|
||||||
|
# SMTP
|
||||||
|
|
||||||
|
#GF_SMTP_HOST=
|
||||||
|
#GF_SMTP_USER=
|
||||||
|
#GF_SMTP_PASSWORD=
|
||||||
|
#GF_SMTP_FROM_ADDRESS=
|
||||||
|
#GF_SMTP_FROM_NAME=
|
||||||
|
|
||||||
|
#######
|
||||||
|
# REDIS
|
||||||
|
|
||||||
|
#GF_REMOTE_CACHE_CONNSTR=
|
||||||
|
|
||||||
|
#########
|
||||||
|
# TRAEFIK
|
||||||
|
|
||||||
|
#TRAEFIK_NETWORK_NAME=
|
||||||
|
#TRAEFIK_ROUTER_NAME= # Don't use char '.'
|
||||||
|
#TRAEFIK_ENTRYPOINTS=
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Grafana
|
||||||
|
|
||||||
|
> Grafana est un logiciel libre sous licence GNU Affero General Public License Version 32 (anciennement sous licence Apache 2.0 avant avril 2021) qui permet la visualisation de données. Il permet de réaliser des tableaux de bord et des graphiques depuis plusieurs sources dont des bases de données temporelles comme Graphite (en), InfluxDB et OpenTSDB3.
|
||||||
|
>
|
||||||
|
> -- <cite>[Wikipédia](https://fr.wikipedia.org/wiki/Grafana)</cite>
|
||||||
|
|
||||||
|
## 🔧 Configuration
|
||||||
|
|
||||||
|
La configuration du service ce base sur la documentation officiel plusieurs pages sont intéressante à lire :
|
||||||
|
- [Lancer l'image Docker de Grafana](https://grafana.com/docs/grafana/latest/installation/docker/)
|
||||||
|
- [Configuration l'image Docker Grafana](https://grafana.com/docs/grafana/latest/administration/configure-docker/)
|
||||||
|
- [Surcharger la configuration à l'aide des variables d'environment](https://grafana.com/docs/grafana/latest/administration/configuration/#override-configuration-with-environment-variables)
|
||||||
|
|
||||||
|
## 🔗 Liens
|
||||||
|
|
||||||
|
- [Site officiel](https://grafana.com)
|
||||||
|
- [La documentation](https://grafana.com/docs)
|
||||||
|
- [Github](https://github.com/grafana/grafana)
|
||||||
|
- [L'image Docker sur Docker Hub](https://hub.docker.com/r/grafana/grafana)
|
|
@ -0,0 +1,11 @@
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
environment:
|
||||||
|
# https://grafana.com/docs/grafana/latest/administration/configuration/#database
|
||||||
|
GF_DATABASE_TYPE: postgres
|
||||||
|
GF_DATABASE_HOST: postgres # Name is same as ../postgres/docker-compose.yml:8
|
||||||
|
GF_DATABASE_NAME: ${POSTGRES_DB:?err}
|
||||||
|
GF_DATABASE_USER: ${POSTGRES_USER:?err}
|
||||||
|
GF_DATABASE_PASSWORD: ${POSTGRES_PASSWORD:?err}
|
|
@ -0,0 +1,8 @@
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
environment:
|
||||||
|
# https://grafana.com/docs/grafana/latest/administration/configuration/#remote_cache
|
||||||
|
GF_REMOTE_CACHE_TYPE: redis
|
||||||
|
GF_REMOTE_CACHE_CONNSTR: ${GF_REMOTE_CACHE_CONNSTR:-addr=redis:6379,ssl=false}
|
|
@ -0,0 +1,12 @@
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
environment:
|
||||||
|
# https://grafana.com/docs/grafana/latest/administration/configuration/#smtp
|
||||||
|
GF_SMTP_ENABLED: true
|
||||||
|
GF_SMTP_HOST: ${GF_SMTP_HOST:?err} # with port
|
||||||
|
GF_SMTP_USER: ${GF_SMTP_USER:?err}
|
||||||
|
GF_SMTP_PASSWORD: ${GF_SMTP_PASSWORD:?err}
|
||||||
|
GF_SMTP_FROM_ADDRESS: ${GF_SMTP_FROM_ADDRESS:?err}
|
||||||
|
GF_SMTP_FROM_NAME: ${GF_SMTP_FROM_NAME:?err}
|
|
@ -0,0 +1,13 @@
|
||||||
|
version: "3.8"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
name: ${TRAEFIK_NETWORK_NAME:-traefik}
|
||||||
|
|
||||||
|
services:
|
||||||
|
grafana:
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.docker.network=${TRAEFIK_NETWORK_NAME:-traefik}
|
||||||
|
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-grafana}.rule=Host(`${GRAFANA_DOMAIN:?err}`)
|
||||||
|
- traefik.http.routers.${TRAEFIK_ROUTER_NAME:-grafana}.entrypoints=${TRAEFIK_ENTRYPOINTS:-web}
|
|
@ -1,9 +1,5 @@
|
||||||
---
|
---
|
||||||
version: "3"
|
version: "3.8"
|
||||||
|
|
||||||
networks:
|
|
||||||
default:
|
|
||||||
name: ${TRAEFIK_NETWORK_NAME:-traefik}
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
grafana:
|
grafana:
|
||||||
|
@ -12,17 +8,14 @@ volumes:
|
||||||
services:
|
services:
|
||||||
grafana:
|
grafana:
|
||||||
container_name: ${GRAFANA_CONTAINER_NAME:-grafana}
|
container_name: ${GRAFANA_CONTAINER_NAME:-grafana}
|
||||||
image: ${GRAFANA_IMAGE:-grafana/grafana:8.2.2}
|
image: ${GRAFANA_IMAGE:-grafana/grafana:8.2.5}
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- grafana:/var/lib/grafana
|
- grafana:/var/lib/grafana
|
||||||
environment:
|
environment:
|
||||||
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER:?err}
|
GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER:?err}
|
||||||
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:?err}
|
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:?err}
|
||||||
|
GF_SECURITY_DISABLE_GRAVATAR: ${GF_SECURITY_DISABLE_GRAVATAR:-true}
|
||||||
|
GF_SECURITY_COOKIE_SECURE: ${GF_SECURITY_COOKIE_SECURE:-true}
|
||||||
GF_USERS_ALLOW_SIGN_UP: ${GF_USERS_ALLOW_SIGN_UP:-false}
|
GF_USERS_ALLOW_SIGN_UP: ${GF_USERS_ALLOW_SIGN_UP:-false}
|
||||||
GF_INSTALL_PLUGINS: ${GF_INSTALL_PLUGINS}
|
GF_INSTALL_PLUGINS: ${GF_INSTALL_PLUGINS}
|
||||||
labels:
|
|
||||||
traefik.enable: 'true'
|
|
||||||
traefik.docker.network: ${TRAEFIK_NETWORK_NAME:-traefik}
|
|
||||||
traefik.http.routers.grafana.rule: 'Host(`${GRAFANA_DOMAIN:?err}`)'
|
|
||||||
traefik.http.routers.grafana.entrypoints: 'web'
|
|
||||||
|
|
Loading…
Reference in New Issue