prometheus et munin fonctionnent dans le compose
This commit is contained in:
@@ -1,56 +1,103 @@
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
|
etherpad:
|
||||||
|
image: etherpad/etherpad:1.9.7
|
||||||
|
ports:
|
||||||
|
- "9001:9001"
|
||||||
|
volumes:
|
||||||
|
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:9001', res => { process.exit(res.statusCode===200?0:1) }).on('error', ()=>process.exit(1))\"" ]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
start_period: 15s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
mail:
|
||||||
|
image: bytemark/smtp:latest
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "2525:25"
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mysql:8.4
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=root
|
||||||
|
- MYSQL_DATABASE=tlc
|
||||||
|
- MYSQL_USER=tlc
|
||||||
|
- MYSQL_PASSWORD=tlc
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 1m
|
||||||
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
|
back:
|
||||||
|
image: benarbause/doodleback-with-quarkus:latest
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
volumes:
|
||||||
|
- ../doodlestudent/api:/app
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
etherpad:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
restart:
|
||||||
|
unless-stopped
|
||||||
|
|
||||||
#https://dev.to/rafi021/how-to-set-up-a-monitoring-stack-with-prometheus-grafana-and-node-exporter-using-docker-compose-17cc
|
#https://dev.to/rafi021/how-to-set-up-a-monitoring-stack-with-prometheus-grafana-and-node-exporter-using-docker-compose-17cc
|
||||||
#https://belginux.com/monitoring-docker-grafana-prometheus-cadvisor/
|
#https://belginux.com/monitoring-docker-grafana-prometheus-cadvisor/
|
||||||
#https://github.com/Einsteinish/Docker-Compose-Prometheus-and-Grafana/tree/master
|
#https://github.com/Einsteinish/Docker-Compose-Prometheus-and-Grafana/tree/master
|
||||||
# prometheus:
|
prometheus:
|
||||||
# image: prom/prometheus:latest
|
image: prom/prometheus:latest
|
||||||
# container_name: prometheus
|
container_name: prometheus
|
||||||
# restart: unless-stopped
|
restart: unless-stopped
|
||||||
# ports:
|
ports:
|
||||||
# - "9090:9090"
|
- "9090:9090"
|
||||||
# volumes:
|
volumes:
|
||||||
# - ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
- ../prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||||
# command:
|
command:
|
||||||
# - "--config.file=/etc/prometheus/prometheus.yml"
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
||||||
# depends_on:
|
depends_on:
|
||||||
# - back
|
- back
|
||||||
# - db
|
- db
|
||||||
# networks:
|
networks:
|
||||||
# - app-network
|
- app-network
|
||||||
|
|
||||||
# grafana:
|
grafana:
|
||||||
# build:
|
# build:
|
||||||
# context: ..
|
# context: ..
|
||||||
# dockerfile: dockerfiles/grafana/Dockerfile
|
# dockerfile: dockerfiles/grafana/Dockerfile
|
||||||
# container_name: grafana
|
image: grafana/grafana:12.3
|
||||||
# restart: unless-stopped
|
container_name: grafana
|
||||||
# volumes:
|
restart: unless-stopped
|
||||||
# - grafana-data:/var/lib/grafana
|
volumes:
|
||||||
# - ../grafana/provisioning:/etc/grafana/provisioning
|
- grafana-data:/var/lib/grafana
|
||||||
# depends_on:
|
- ../grafana/provisioning:/etc/grafana/provisioning
|
||||||
# - prometheus
|
depends_on:
|
||||||
# environment:
|
- prometheus
|
||||||
# - GF_SECURITY_ADMIN_USER=tlc
|
environment:
|
||||||
# - GF_SECURITY_ADMIN_PASSWORD=tlc
|
- GF_SECURITY_ADMIN_USER=tlc
|
||||||
# networks:
|
- GF_SECURITY_ADMIN_PASSWORD=tlc
|
||||||
# - app-network
|
- GF_INSTALL_PLUGINS=grafana-munin-datasource # Telechargement du plugin via var d'env
|
||||||
|
networks:
|
||||||
# https://stackoverflow.com/questions/57591868/how-correctly-install-ssl-certificate-using-certbot-in-docker
|
- app-network
|
||||||
# certbot:
|
|
||||||
# image: certbot/certbot:v5.3.1
|
|
||||||
# container_name: certbot
|
|
||||||
# depends_on:
|
|
||||||
# - front
|
|
||||||
# volumes:
|
|
||||||
# - ../certbot/www/:/var/www/certbot/:rw
|
|
||||||
# - ../certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
|
|
||||||
|
|
||||||
front:
|
front:
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: dockerfiles/front/Dockerfile
|
dockerfile: dockerfiles/front/Dockerfile
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -67,64 +114,21 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
|
|
||||||
|
# https://stackoverflow.com/questions/57591868/how-correctly-install-ssl-certificate-using-certbot-in-docker
|
||||||
back:
|
certbot:
|
||||||
image : benarbause/doodleback-with-quarkus:latest
|
image: certbot/certbot:v5.3.1
|
||||||
ports:
|
container_name: certbot
|
||||||
- "8080:8080"
|
|
||||||
volumes:
|
|
||||||
- ../doodlestudent/api:/app
|
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
- front
|
||||||
condition: service_healthy
|
|
||||||
etherpad:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
restart:
|
|
||||||
unless-stopped
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: mysql:8.4
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
environment:
|
|
||||||
- MYSQL_ROOT_PASSWORD=root
|
|
||||||
- MYSQL_DATABASE=tlc
|
|
||||||
- MYSQL_USER=tlc
|
|
||||||
- MYSQL_PASSWORD=tlc
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"]
|
|
||||||
interval: 10s
|
|
||||||
timeout: 1m
|
|
||||||
retries: 5
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
etherpad:
|
|
||||||
image: etherpad/etherpad:1.9.7
|
|
||||||
ports:
|
|
||||||
- "9001:9001"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ../doodlestudent/api/APIKEY.txt:/opt/etherpad-lite/APIKEY.txt
|
- ../certbot/www/:/var/www/certbot/:rw
|
||||||
networks:
|
- ../certbot/conf/:/etc/letsencrypt/:rw
|
||||||
- app-network
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:9001', res => { process.exit(res.statusCode===200?0:1) }).on('error', ()=>process.exit(1))\""]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
start_period: 15s
|
|
||||||
retries: 5
|
|
||||||
|
|
||||||
mail:
|
|
||||||
image: bytemark/smtp:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "2525:25"
|
|
||||||
networks:
|
|
||||||
- app-network
|
|
||||||
|
|
||||||
networks: # Declare the network to be used by the services
|
networks: # Declare the network to be used by the services
|
||||||
app-network: # Is a user-defined network
|
app-network: # Is a user-defined network
|
||||||
#external: false # If true, Docker Compose will look for an existing network with the same name and use it. If false or not specified, Docker Compose will create a new network.
|
#external: false # If true, Docker Compose will look for an existing network with the same name and use it. If false or not specified, Docker Compose will create a new network.
|
||||||
name: app-network #Name of the network (optional, Docker Compose will generate one if not provided)
|
name: app-network #Name of the network (optional, Docker Compose will generate one if not provided)
|
||||||
|
|
||||||
|
volumes :
|
||||||
|
grafana-data:
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
FROM grafana/grafana:12.3
|
FROM grafana/grafana:12.3
|
||||||
RUN grafana-cli plugins install grafana-munin-datasource
|
|
||||||
|
USER root
|
||||||
|
RUN grafana-cli plugins install grafana-munin-datasource
|
||||||
|
USER grafana
|
||||||
@@ -53,19 +53,27 @@
|
|||||||
port: "{{ http_port }}"
|
port: "{{ http_port }}"
|
||||||
proto: tcp
|
proto: tcp
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install munin
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- munin-node
|
||||||
|
state: present
|
||||||
|
|
||||||
|
# TODO : d'ou est ajoute le fichier /etc/muning/munin-node.conf ?
|
||||||
# Munin Configuration
|
# Munin Configuration
|
||||||
#https://stackoverflow.com/questions/77941169/ansible-add-line-update-etc-hosts-when-outdated
|
#https://stackoverflow.com/questions/77941169/ansible-add-line-update-etc-hosts-when-outdated
|
||||||
# - name: Install Munin Node
|
- name: Install Munin Node
|
||||||
# ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
# path: /etc/munin/munin-node.conf
|
path: /etc/munin/munin-node.conf
|
||||||
# regexp: '^allow'
|
regexp: '^allow'
|
||||||
# line: "allow ^127\\.0\\.0\\.1$"
|
line: "allow ^127\\.0\\.0\\.1$"
|
||||||
#
|
|
||||||
# - name: Restart munin-node
|
- name: Restart munin-node
|
||||||
# systemd:
|
systemd:
|
||||||
# name: munin-node
|
name: munin-node
|
||||||
# state: restarted
|
state: restarted
|
||||||
# enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
- name: Install Docker plugins
|
- name: Install Docker plugins
|
||||||
apt:
|
apt:
|
||||||
|
|||||||
Reference in New Issue
Block a user