File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ RUN apk add --no-cache \
51
51
postgresql-libs \
52
52
ttf-ubuntu-font-family
53
53
54
+ RUN addgroup -S -g 101 netbox \
55
+ && adduser -DHS -u 101 netbox \
56
+ && adduser netbox netbox
57
+
54
58
WORKDIR /opt
55
59
56
60
COPY --from=builder /install /usr/local
@@ -68,6 +72,12 @@ COPY configuration/configuration.py /etc/netbox/config/configuration.py
68
72
69
73
WORKDIR /opt/netbox/netbox
70
74
75
+ # Must set permissions for '/opt/netbox/netbox/static' directory
76
+ # to a+w so that `./manage.py collectstatic` can be executed during
77
+ # container startup.
78
+ # Not satisfying
79
+ RUN mkdir static && chmod a+w static media
80
+
71
81
ENTRYPOINT [ "/opt/netbox/docker-entrypoint.sh" ]
72
82
73
83
CMD ["gunicorn" , "-c /etc/netbox/config/gunicorn_config.py" , "netbox.wsgi" ]
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ services:
7
7
- redis
8
8
- netbox-worker
9
9
env_file : env/netbox.env
10
+ user : netbox
10
11
volumes :
11
12
- ./startup_scripts:/opt/netbox/startup_scripts:z,ro
12
13
- ./initializers:/opt/netbox/initializers:z,ro
You can’t perform that action at this time.
0 commit comments