File tree 1 file changed +21
-7
lines changed
1 file changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ services:
6
6
- postgres
7
7
- redis
8
8
- redis-cache
9
- - netbox-worker
10
9
env_file : env/netbox.env
11
10
user : ' unit:root'
11
+ healthcheck :
12
+ start_period : 60s
13
+ timeout : 3s
14
+ interval : 15s
15
+ test : " curl -f http://localhost:8080/api/ || exit 1"
12
16
volumes :
13
17
- ./configuration:/etc/netbox/config:z,ro
14
18
- ./reports:/etc/netbox/reports:z,ro
@@ -17,19 +21,29 @@ services:
17
21
netbox-worker :
18
22
<< : *netbox
19
23
depends_on :
20
- - redis
21
- - postgres
24
+ netbox :
25
+ condition : service_healthy
22
26
command :
23
27
- /opt/netbox/venv/bin/python
24
28
- /opt/netbox/netbox/manage.py
25
29
- rqworker
30
+ healthcheck :
31
+ start_period : 20s
32
+ timeout : 3s
33
+ interval : 15s
34
+ test : " ps -aux | grep -v grep | grep -q rqworker || exit 1"
26
35
netbox-housekeeping :
27
36
<< : *netbox
28
37
depends_on :
29
- - redis
30
- - postgres
38
+ netbox :
39
+ condition : service_healthy
31
40
command :
32
41
- /opt/netbox/housekeeping.sh
42
+ healthcheck :
43
+ start_period : 20s
44
+ timeout : 3s
45
+ interval : 15s
46
+ test : " ps -aux | grep -v grep | grep -q housekeeping || exit 1"
33
47
34
48
# postgres
35
49
postgres :
@@ -56,7 +70,7 @@ services:
56
70
- redis-server --requirepass $$REDIS_PASSWORD # # $$ because of docker-compose
57
71
env_file : env/redis-cache.env
58
72
volumes :
59
- - netbox-redis-cache-data:/data
73
+ - netbox-redis-cache-data:/data
60
74
61
75
volumes :
62
76
netbox-media-files :
@@ -66,4 +80,4 @@ volumes:
66
80
netbox-redis-data :
67
81
driver : local
68
82
netbox-redis-cache-data :
69
- driver : local
83
+ driver : local
You can’t perform that action at this time.
0 commit comments