forked from netbox-community/netbox-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
99 lines (93 loc) · 2.75 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
---
# 2023.11.26 - another first try
# Arentas
version: '3.4'
services:
netbox: &netbox
image: docker.io/netboxcommunity/netbox:${VERSION-v3.6-2.7.0}
depends_on:
- postgres
- redis
- redis-cache
env_file: stack.env
user: 'unit:root'
ports:
- "8008:8080"
healthcheck:
start_period: 60s
timeout: 3s
interval: 15s
test: "curl -f http://localhost:8080/api/ || exit 1"
volumes:
- /mnt/lvol-docker/AppData/netbox/etc/netbox/config:/etc/netbox/config:z,ro
- /mnt/lvol-docker/AppData/netbox/media-files:/opt/netbox/netbox/media:rw
- /mnt/lvol-docker/AppData/netbox/reports-files:/opt/netbox/netbox/reports:rw
- /mnt/lvol-docker/AppData/netbox/scripts-files:/opt/netbox/netbox/scripts:rw
## Netbox-worker ##############################
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-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: stack.env
volumes:
- /mnt/lvol-docker/AppData/netbox/postgres-data:/var/lib/postgresql/data:rw
## 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: stack.env
volumes:
- /mnt/lvol-docker/AppData/netbox/redis-data:/data:rw
## Redis cache ##############################
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: stack.env
volumes:
- /mnt/lvol-docker/AppData/netbox/redis-cache-data:/data:rw
# Volumes per original compose file, left for reference only.
#volumes:
# 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