2019-10-10 12:42:10 +02:00
|
|
|
version: '3.4'
|
2017-04-19 16:48:21 +02:00
|
|
|
services:
|
2018-08-13 23:04:09 +02:00
|
|
|
netbox: &netbox
|
2019-02-06 11:46:20 +01:00
|
|
|
image: netboxcommunity/netbox:${VERSION-latest}
|
2018-08-13 23:04:09 +02:00
|
|
|
depends_on:
|
|
|
|
- postgres
|
|
|
|
- redis
|
2019-12-16 12:51:59 +01:00
|
|
|
- redis-cache
|
2018-08-13 23:04:09 +02:00
|
|
|
- netbox-worker
|
2018-09-05 23:37:28 +02:00
|
|
|
env_file: env/netbox.env
|
2019-11-18 08:23:44 +01:00
|
|
|
user: '101'
|
2018-08-13 23:04:09 +02:00
|
|
|
volumes:
|
2019-03-25 21:22:37 +01:00
|
|
|
- ./startup_scripts:/opt/netbox/startup_scripts:z,ro
|
|
|
|
- ./initializers:/opt/netbox/initializers:z,ro
|
|
|
|
- ./configuration:/etc/netbox/config:z,ro
|
|
|
|
- ./reports:/etc/netbox/reports:z,ro
|
2019-10-14 09:47:18 +02:00
|
|
|
- ./scripts:/etc/netbox/scripts:z,ro
|
2019-03-25 21:22:37 +01:00
|
|
|
- netbox-nginx-config:/etc/netbox-nginx:z
|
|
|
|
- netbox-static-files:/opt/netbox/netbox/static:z
|
|
|
|
- netbox-media-files:/opt/netbox/netbox/media:z
|
2020-10-18 15:16:16 +02:00
|
|
|
- type: tmpfs
|
|
|
|
target: /tmp/metrics
|
|
|
|
read_only: false
|
2018-08-13 23:04:09 +02:00
|
|
|
netbox-worker:
|
|
|
|
<<: *netbox
|
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
entrypoint:
|
|
|
|
- python3
|
|
|
|
- /opt/netbox/netbox/manage.py
|
|
|
|
command:
|
|
|
|
- rqworker
|
2020-10-18 15:16:16 +02:00
|
|
|
|
|
|
|
# nginx
|
2018-08-13 23:04:09 +02:00
|
|
|
nginx:
|
|
|
|
command: nginx -c /etc/netbox-nginx/nginx.conf
|
2020-09-01 13:34:42 +02:00
|
|
|
image: nginx:1.19-alpine
|
2018-08-13 23:04:09 +02:00
|
|
|
depends_on:
|
|
|
|
- netbox
|
|
|
|
ports:
|
|
|
|
- 8080
|
|
|
|
volumes:
|
|
|
|
- netbox-static-files:/opt/netbox/netbox/static:ro
|
|
|
|
- netbox-nginx-config:/etc/netbox-nginx/:ro
|
2020-10-18 15:16:16 +02:00
|
|
|
|
|
|
|
nginx-exporter:
|
|
|
|
image: nginx/nginx-prometheus-exporter
|
|
|
|
depends_on:
|
|
|
|
- nginx
|
|
|
|
command:
|
|
|
|
- -nginx.scrape-uri
|
|
|
|
- http://nginx:8081/stub_status
|
|
|
|
|
|
|
|
# postgres
|
2018-08-13 23:04:09 +02:00
|
|
|
postgres:
|
2020-09-01 13:34:42 +02:00
|
|
|
image: postgres:12-alpine
|
2018-09-05 23:37:28 +02:00
|
|
|
env_file: env/postgres.env
|
2018-08-13 23:04:09 +02:00
|
|
|
volumes:
|
|
|
|
- netbox-postgres-data:/var/lib/postgresql/data
|
2020-10-18 15:16:16 +02:00
|
|
|
|
|
|
|
postgres-exporter:
|
|
|
|
image: wrouesnel/postgres_exporter:v0.8.0
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
|
|
|
env_file: env/postgres-exporter.env
|
|
|
|
|
|
|
|
# redis
|
|
|
|
redis: &redis
|
2020-09-01 13:34:42 +02:00
|
|
|
image: redis:6-alpine
|
2018-08-14 00:19:29 +02:00
|
|
|
command:
|
|
|
|
- sh
|
|
|
|
- -c # this is to evaluate the $REDIS_PASSWORD from the env
|
|
|
|
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
|
2020-10-18 15:16:16 +02:00
|
|
|
env_file: env/redis-worker.env
|
2018-08-13 23:04:09 +02:00
|
|
|
volumes:
|
|
|
|
- netbox-redis-data:/data
|
2019-12-16 12:51:59 +01:00
|
|
|
redis-cache:
|
2020-09-01 13:34:42 +02:00
|
|
|
image: redis:6-alpine
|
2019-12-16 12:51:59 +01:00
|
|
|
command:
|
|
|
|
- sh
|
|
|
|
- -c # this is to evaluate the $REDIS_PASSWORD from the env
|
2020-10-18 15:16:16 +02:00
|
|
|
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
|
2020-02-14 12:33:28 +01:00
|
|
|
env_file: env/redis-cache.env
|
2020-10-18 15:16:16 +02:00
|
|
|
|
|
|
|
redis-worker-exporter:
|
|
|
|
image: oliver006/redis_exporter
|
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
env_file: env/redis-worker-exporter.env
|
|
|
|
redis-cache-exporter:
|
|
|
|
image: oliver006/redis_exporter
|
|
|
|
depends_on:
|
|
|
|
- redis-cache
|
|
|
|
env_file: env/redis-cache-exporter.env
|
|
|
|
|
|
|
|
# prometheus
|
|
|
|
prometheus:
|
|
|
|
image: prom/prometheus:v2.22.0
|
|
|
|
depends_on:
|
|
|
|
- postgres-exporter
|
|
|
|
- redis-cache-exporter
|
|
|
|
- redis-worker-exporter
|
|
|
|
- nginx-exporter
|
|
|
|
- netbox
|
|
|
|
ports:
|
|
|
|
- 9090
|
|
|
|
volumes:
|
|
|
|
- ./monitoring/prometheus/:/etc/prometheus/
|
|
|
|
- prometheus-data:/prometheus/data
|
|
|
|
|
|
|
|
# grafana
|
|
|
|
grafana:
|
|
|
|
image: grafana/grafana:7.2.1
|
|
|
|
depends_on:
|
|
|
|
- prometheus
|
|
|
|
ports:
|
|
|
|
- 3000
|
|
|
|
volumes:
|
|
|
|
- ./monitoring/grafana/plugins/:/var/lib/grafana/plugins/:z,ro
|
|
|
|
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning/:z,ro
|
|
|
|
- ./monitoring/grafana/dashboards/:/etc/grafana/dashboards/:z,ro
|
|
|
|
- grafana-data:/var/lib/grafana
|
|
|
|
|
2017-04-19 16:48:21 +02:00
|
|
|
volumes:
|
2018-08-13 23:04:09 +02:00
|
|
|
netbox-static-files:
|
|
|
|
driver: local
|
|
|
|
netbox-nginx-config:
|
|
|
|
driver: local
|
|
|
|
netbox-media-files:
|
|
|
|
driver: local
|
|
|
|
netbox-postgres-data:
|
|
|
|
driver: local
|
|
|
|
netbox-redis-data:
|
|
|
|
driver: local
|
2020-10-18 15:16:16 +02:00
|
|
|
prometheus-data:
|
|
|
|
driver: local
|
|
|
|
grafana-data:
|
|
|
|
driver: local
|