Vue d'ensemble DevOps
Documentation infrastructure et deploiement pour MyTelevision API v2.
Stack DevOps
| Outil | Usage |
|---|---|
| Docker | Containerisation (multi-stage builds, profiles dev/staging/prod) |
| GitHub Actions | CI/CD (lint, test, build, security, quality gate) |
| Nginx 1.24.0 | Reverse proxy sur le serveur de production |
| Cloudflare | WAF, CDN, DNS, certificats TLS |
| Prometheus | Collecte de metriques |
| Grafana | Dashboards et visualisation |
| Alertmanager | Routage et notifications d'alertes |
| Loki | Agregation de logs |
| Kubernetes | Orchestration de conteneurs |
| Helm | Package manager Kubernetes |
Architecture Infrastructure
Internet
|
[Cloudflare]
WAF / CDN
|
┌────────────────┐
│ Nginx 1.24.0 │
│ Reverse Proxy │
│ 185.246.87.50 │
│ (Ubuntu) │
└───────┬────────┘
|
+-------------+-------------+
| | |
[API Pod 1] [API Pod 2] [API Pod N]
NestJS :3000 NestJS :3000
| | |
+-------------+-------------+
|
+--------------+---------------+
| | |
[PostgreSQL] [Redis] [Cloudflare R2]
:5432 :6379 Storage
Environnements
| Environnement | Infrastructure | URL | Objectif |
|---|---|---|---|
| Development | Docker local | localhost:3000 | Developpement local |
| Staging | Docker + Nginx | staging-api.mytelevision.app | QA & Tests |
| Production | Docker + Nginx + Cloudflare | api.mytelevision.app | Production |
Serveur de production
| Parametre | Valeur |
|---|---|
| IP | 185.246.87.50 |
| OS | Ubuntu |
| Reverse Proxy | Nginx 1.24.0 |
| CDN / WAF | Cloudflare |
Commandes rapides
Docker local
# Demarrer tous les services
docker compose up -d
# Demarrer avec un profile specifique
docker compose --profile dev up -d
docker compose --profile staging up -d
docker compose --profile prod up -d
# Voir les logs
docker compose logs -f api
# Arreter
docker compose down
Deploy Staging
kubectl apply -k k8s/overlays/staging/
Deploy Production
helm upgrade mytv-api ./helm/mytv-api -f values-prod.yaml
SLA Targets
| Metrique | Target |
|---|---|
| Disponibilite | 99.9% |
| Latence P95 | < 500ms |
| Error Rate | < 0.1% |
| RTO | < 1h |
| RPO | < 15min |
Sections de la documentation DevOps
| Section | Description |
|---|---|
| Docker | Containerisation, multi-stage builds, profiles et docker-compose |
| CI/CD | Pipelines GitHub Actions, pre-commit hooks, Dependabot |
| Kubernetes | Deploiement K8s, manifests, Helm charts, IaC Terraform |
| Monitoring | Prometheus, Grafana, Alertmanager, metriques applicatives |
| Logging | Logging structure JSON, Loki, audit logs |
| Secrets | Gestion des secrets, rotation, bonnes pratiques |