63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# APP EXEMPLE
|
|
nginx-app:
|
|
container_name: nginx-app
|
|
image: nginx
|
|
# NECESSARY FOR LOKI
|
|
labels:
|
|
logging: "promtail"
|
|
logging_jobname: "containerlogs"
|
|
ports:
|
|
- 8080:80
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:80"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: grafana
|
|
ports:
|
|
- 3000:3000
|
|
volumes:
|
|
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
|
|
- ./grafana/dashboards:/var/lib/grafana/dashboards
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
loki:
|
|
image: grafana/loki:latest
|
|
container_name: loki
|
|
ports:
|
|
- 3100:3100
|
|
volumes:
|
|
- ./loki/config:/etc/loki
|
|
- ./loki/certs:/etc/loki/certs
|
|
command: -config.file=/etc/loki/config.yml
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:3100/ready"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
promtail:
|
|
image: grafana/promtail:latest
|
|
container_name: promtail
|
|
volumes:
|
|
- ./promtail/config.yml:/etc/promtail/config.yml
|
|
- /var/lib/docker/containers:/var/lib/docker/containers:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /var/log:/var/log
|
|
command: -config.file=/etc/promtail/config.yml
|
|
depends_on:
|
|
- loki
|