-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (26 loc) · 946 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:2.7
MAINTAINER Artem Silenkov <[email protected]>
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sudo graphviz postgresql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Clone and install netbox
ENV NETBOX_COMMIT 328958876aae64fd970605704aaaa79af61de1d6
RUN mkdir -p /usr/src/netbox \
&& git clone https://github.com/digitalocean/netbox.git /usr/src/netbox \
&& (cd /usr/src/netbox && pip install --no-cache-dir -r requirements.txt)
# Change workdir
WORKDIR /usr/src/netbox/netbox
# Create user
RUN groupadd -g 1000 netbox \
&& useradd -u 1000 -g 1000 -d /usr/src/netbox netbox \
&& chown -R netbox: /usr/src/netbox
# Setup entrypoint
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
# Expose ports
EXPOSE 8888/tcp
ENTRYPOINT ["/sbin/entrypoint.sh"]
CMD ["runserver", "--insecure", "0.0.0.0:8888"]