Optimised Django installation

With version 2.5.11 Netbox moved to Django 2.2 but the Dockerfile
stilled pulled 2.1.x in. With this change the requirements from Netbox
are installed first. So we have the correct version of Django installed
and the additional software can use is directly
This commit is contained in:
Tobias Genannt 2019-05-07 09:51:46 +02:00
parent 9eef398a9d
commit 9f0e02a984

View file

@ -15,20 +15,6 @@ RUN apk add --no-cache \
ttf-ubuntu-font-family \ ttf-ubuntu-font-family \
wget wget
RUN pip install \
# gunicorn is used for launching netbox
gunicorn \
# napalm is used for gathering information from network devices
napalm \
# ruamel is used in startup_scripts
ruamel.yaml \
# pinning django to the version required by netbox
# adding it here, to install the correct version of
# django-rq
'Django>=2.1.5,<2.2' \
# django-rq is used for webhooks
django-rq
WORKDIR /opt WORKDIR /opt
ARG BRANCH=master ARG BRANCH=master
@ -39,6 +25,16 @@ RUN wget -q -O - "${URL}" | tar xz \
WORKDIR /opt/netbox WORKDIR /opt/netbox
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
RUN pip install \
# gunicorn is used for launching netbox
gunicorn \
# napalm is used for gathering information from network devices
napalm \
# ruamel is used in startup_scripts
ruamel.yaml \
# django-rq is used for webhooks
django-rq
COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py COPY docker/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
COPY configuration/gunicorn_config.py /etc/netbox/config/ COPY configuration/gunicorn_config.py /etc/netbox/config/
COPY docker/nginx.conf /etc/netbox-nginx/nginx.conf COPY docker/nginx.conf /etc/netbox-nginx/nginx.conf