File tree Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Expand file tree Collapse file tree 4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -62,11 +62,12 @@ RUN apk add --no-cache \
62
62
libevent \
63
63
libffi \
64
64
libjpeg-turbo \
65
- openssl \
66
65
libxslt \
66
+ openssl \
67
67
postgresql-libs \
68
- python3 \
69
68
py3-pip \
69
+ python3 \
70
+ tini \
70
71
unit \
71
72
unit-python3
72
73
@@ -82,6 +83,7 @@ COPY ${NETBOX_PATH} /opt/netbox
82
83
83
84
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
84
85
COPY docker/docker-entrypoint.sh /opt/netbox/docker-entrypoint.sh
86
+ COPY docker/housekeeping.sh /opt/netbox/housekeeping.sh
85
87
COPY docker/launch-netbox.sh /opt/netbox/launch-netbox.sh
86
88
COPY startup_scripts/ /opt/netbox/startup_scripts/
87
89
COPY initializers/ /opt/netbox/initializers/
Original file line number Diff line number Diff line change @@ -20,11 +20,24 @@ services:
20
20
<< : *netbox
21
21
depends_on :
22
22
- redis
23
+ - postgres
23
24
entrypoint :
25
+ - " /sbin/tini"
26
+ - " --"
27
+ command :
24
28
- /opt/netbox/venv/bin/python
25
29
- /opt/netbox/netbox/manage.py
26
- command :
27
30
- rqworker
31
+ netbox-housekeeping :
32
+ << : *netbox
33
+ depends_on :
34
+ - redis
35
+ - postgres
36
+ entrypoint :
37
+ - " /sbin/tini"
38
+ - " --"
39
+ command :
40
+ - /opt/netbox/housekeeping.sh
28
41
29
42
# postgres
30
43
postgres :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ SECONDS=${HOUSEKEEPING_INTERVAL:= 86400}
3
+ echo " Interval set to ${SECONDS} seconds"
4
+ while true ; do
5
+ date
6
+ /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py housekeeping
7
+ sleep ${SECONDS} s
8
+ done
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ EMAIL_USERNAME=netbox
14
14
# EMAIL_USE_SSL and EMAIL_USE_TLS are mutually exclusive, i.e. they can't both be `true`!
15
15
EMAIL_USE_SSL = false
16
16
EMAIL_USE_TLS = false
17
+ HOUSEKEEPING_INTERVAL = 86400
17
18
MAX_PAGE_SIZE = 1000
18
19
MEDIA_ROOT = /opt/netbox/netbox/media
19
20
METRICS_ENABLED = false
You can’t perform that action at this time.
0 commit comments