-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose-dev.yaml
More file actions
103 lines (96 loc) · 2.42 KB
/
docker-compose-dev.yaml
File metadata and controls
103 lines (96 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
services:
db:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5432:5432"
volumes:
- dev-db:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus.rules.yml:/etc/prometheus/prometheus.rules.yml
networks:
- app-network
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.enable-lifecycle'
depends_on:
- alertmanager
alertmanager:
image: prom/alertmanager
container_name: alertmanager
cap_add:
- NET_ADMIN
- NET_RAW
ports:
- "9093:9093"
env_file:
- .env
entrypoint: ["/etc/alertmanager/entrypoint.sh"]
command: ["--config.file=/etc/alertmanager/alertmanager.yml"]
volumes:
- ./alertmanager/alertmanager.template.yml:/etc/alertmanager/alertmanager.template.yml
- ./alertmanager/entrypoint.sh:/etc/alertmanager/entrypoint.sh
- ./alertmanager/templates:/etc/alertmanager/templates
networks:
- app-network
node_exporter:
image: quay.io/prometheus/node-exporter:v1.9.1
container_name: node_exporter
command:
- '--collector.disable-defaults'
- '--collector.cpu'
ports:
- "9100:9100" # Required for Windows/Mac
volumes:
- /proc:/host/proc:ro # Needed for CPU stats
restart: unless-stopped
cadvisor:
image: gcr.io/cadvisor/cadvisor:v0.47.0
container_name: cadvisor
network_mode: host
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
restart: unless-stopped
backup:
build:
context: backup
dockerfile: Dockerfile
networks:
- app-network
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_NAME=postgres
- DB_USER=postgres
- DB_PASSWORD=postgres
- BACKUP_DIR=/backups
- RETENTION_DAYS=2
volumes:
- ./backups:/backups
depends_on:
db:
condition: service_healthy
restart: unless-stopped
volumes:
dev-db:
networks:
app-network:
driver: bridge