1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Robert Drake 4b4602b703 Changes to Dockerfile to make the build faster
To download a new version with docker, I've been running

	git pull
	docker-compose build --no-cache

This is slow, but no-cache is needed so that "git clone" pulls the
latest copy.

Most of the slowness comes from pulling down apt files each time a
rebuild needs to be done.  If we move that into a docker image then only
the local changes need to be rebuilt.

Further refinements could be done.  If the python dependencies that are
brought in from requirements.txt could be moved to an image then nothing
would change between updates as long as dependant versions hadn't
changed.  This would probably be more trouble than it's worth, unless
you're recreating netbox containers 10-20 times a day.
2016-08-18 23:49:41 -04:00

17 lines
505 B
Docker

FROM python:2.7-wheezy
WORKDIR /opt/netbox
ADD . /opt/netbox
RUN git clone --depth 1 https://github.com/digitalocean/netbox.git -b master . \
RUN pip install gunicorn==17.5 && pip install -r requirements.txt
ADD docker/docker-entrypoint.sh /docker-entrypoint.sh
ADD netbox/netbox/configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
ENTRYPOINT [ "/docker-entrypoint.sh" ]
ADD docker/gunicorn_config.py /opt/netbox/
ADD docker/nginx.conf /etc/netbox-nginx/
VOLUME ["/etc/netbox-nginx/"]