feat: Ajout monitoring Prometheus/Grafana et configuration déploiement serveur Linux
- Ajout Prometheus et Grafana au docker-compose.yml - Métriques automatiques pour le backend FastAPI - Configuration de production avec docker-compose.prod.yml - Guide de déploiement manuel pour serveur Linux - Variables d'environnement sécurisées - Documentation complète de déploiement
This commit is contained in:
+48
-4
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Base de données PostgreSQL
|
||||
db:
|
||||
@@ -32,7 +30,7 @@ services:
|
||||
environment:
|
||||
DATABASE_URL: postgresql://user:password@db:5432/dockezr
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "8001:8000"
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
depends_on:
|
||||
@@ -50,7 +48,7 @@ services:
|
||||
container_name: dockezr_frontend
|
||||
restart: always
|
||||
environment:
|
||||
NEXT_PUBLIC_API_URL: http://localhost:8000
|
||||
NEXT_PUBLIC_API_URL: http://localhost:8001
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
@@ -86,6 +84,48 @@ services:
|
||||
profiles:
|
||||
- test
|
||||
|
||||
# Prometheus - Monitoring et métriques
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: dockezr_prometheus
|
||||
restart: always
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||
- prometheus_data:/prometheus
|
||||
command:
|
||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||
- '--storage.tsdb.path=/prometheus'
|
||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||
- '--web.console.templates=/etc/prometheus/consoles'
|
||||
- '--storage.tsdb.retention.time=200h'
|
||||
- '--web.enable-lifecycle'
|
||||
networks:
|
||||
- dockezr_network
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
# Grafana - Tableaux de bord et visualisation
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: dockezr_grafana
|
||||
restart: always
|
||||
ports:
|
||||
- "3001:3000"
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_USER=admin
|
||||
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
||||
- GF_USERS_ALLOW_SIGN_UP=false
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
|
||||
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
|
||||
networks:
|
||||
- dockezr_network
|
||||
depends_on:
|
||||
- prometheus
|
||||
|
||||
networks:
|
||||
dockezr_network:
|
||||
driver: bridge
|
||||
@@ -94,4 +134,8 @@ networks:
|
||||
volumes:
|
||||
postgres_data:
|
||||
name: dockezr_postgres_data
|
||||
prometheus_data:
|
||||
name: dockezr_prometheus_data
|
||||
grafana_data:
|
||||
name: dockezr_grafana_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user