-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
216 lines (199 loc) · 5.15 KB
/
docker-compose.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
---
version: '3.7'
volumes:
prometheus-data:
driver: local
grafana-data:
driver: local
netbox-media-files:
driver: local
netbox-postgres-data:
driver: local
netbox-redis-cache-data:
driver: local
netbox-redis-data:
driver: local
netbox-reports-files:
driver: local
netbox-scripts-files:
driver: local
networks:
inband:
driver: macvlan
driver_opts:
parent: br-inband
ipam:
config:
- subnet: 172.30.0.0/24
gateway: 172.30.0.1
services:
prometheus:
image: prom/prometheus:latest
restart: unless-stopped
depends_on:
netbox:
condition: service_healthy
ports:
- 9090:9090
networks:
default:
inband:
ipv4_address: 172.30.0.2
volumes:
- ./prometheus:/etc/prometheus
- prometheus-data:/prometheus
command: --config.file=/etc/prometheus/prometheus.yml --web.enable-remote-write-receiver
extra_hosts:
- edge1.tdr.id.au:172.30.0.11
- edge2.tdr.id.au:172.30.0.12
- pe1.tdr.id.au:172.30.0.13
- pe2.tdr.id.au:172.30.0.14
gnmic:
image: ghcr.io/openconfig/gnmic:0.31.1
restart: unless-stopped
depends_on:
netbox:
condition: service_healthy
volumes:
- ./gnmic:/etc/gnmic:ro
ports:
- 9804:9804
networks:
default:
inband:
ipv4_address: 172.30.0.3
command: "subscribe --backoff 1s --config /etc/gnmic/gnmic.yaml"
extra_hosts:
- edge1.tdr.id.au:172.30.0.11
- edge2.tdr.id.au:172.30.0.12
- pe1.tdr.id.au:172.30.0.13
- pe2.tdr.id.au:172.30.0.14
snmp_exporter:
image: quay.io/ricardbejarano/snmp_exporter:latest
restart: unless-stopped
ports:
- 9116:9116
networks:
default:
inband:
ipv4_address: 172.30.0.4
volumes:
- ./snmp_exporter:/etc/snmp_exporter/
extra_hosts:
- edge1.tdr.id.au:172.30.0.11
- edge2.tdr.id.au:172.30.0.12
- pe1.tdr.id.au:172.30.0.13
- pe2.tdr.id.au:172.30.0.14
blackbox:
image: quay.io/prometheus/blackbox-exporter:latest
restart: unless-stopped
ports:
- 9115:9115
networks:
default:
inband:
ipv4_address: 172.30.0.6
volumes:
- ./blackbox/config:/config:ro
extra_hosts:
- edge1.tdr.id.au:172.30.0.11
- edge2.tdr.id.au:172.30.0.12
- pe1.tdr.id.au:172.30.0.13
- pe2.tdr.id.au:172.30.0.14
grafana:
image: grafana/grafana:latest
restart: unless-stopped
ports:
- 3000:3000
networks:
default:
inband:
ipv4_address: 172.30.0.5
volumes:
- ./grafana/grafana.ini:/etc/grafana/grafana.ini:ro
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/etc/grafana/dashboards:ro
- grafana-data:/var/lib/grafana
netbox_exporter:
image: ghcr.io/tardoe/ausnog23-netbox_exporter:v1
restart: unless-stopped
ports:
- 9000:9000
networks:
default:
environment:
NETBOX_HOST: http://netbox:8080/
NETBOX_TOKEN: 1dad93aefca48120f2d5f04aaf30aa731ac06705
# -------
# Netbox
# Modified from: https://github.com/netbox-community/netbox-docker/tree/release
# -------
netbox: &netbox
image: ghcr.io/tardoe/ausnog23-netbox-prom-secrets:v5
depends_on:
- postgres
- redis
- redis-cache
env_file: netbox/netbox.env
user: 'unit:root'
healthcheck:
start_period: 60s
timeout: 3s
interval: 15s
test: "curl -f http://localhost:8080/api/ || exit 1"
volumes:
- netbox-media-files:/opt/netbox/netbox/media:z,rw
- netbox-reports-files:/opt/netbox/netbox/reports:z,rw
- netbox-scripts-files:/opt/netbox/netbox/scripts:z,rw
netbox-worker:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q rqworker || exit 1"
netbox-housekeeping:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/housekeeping.sh
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
# postgres
postgres:
image: docker.io/postgres:15-alpine
env_file: netbox/postgres.env
volumes:
- netbox-postgres-data:/var/lib/postgresql/data
- ./netbox_seed.sql:/docker-entrypoint-initdb.d/netbox_seed.sql
# redis
redis:
image: docker.io/redis:7-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: netbox/redis.env
volumes:
- netbox-redis-data:/data
redis-cache:
image: docker.io/redis:7-alpine
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: netbox/redis-cache.env
volumes:
- netbox-redis-cache-data:/data