netbox/Dockerfile

44 lines
1.0 KiB
Docker

FROM debian:11-slim
# set work dir
WORKDIR /root/
# Set build shell to bash, default has has some issues sometimes
SHELL ["/bin/bash", "-c"]
RUN apt update && apt upgrade -y
# Language setup and Initial repo update
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt install git ca-certificates lsb-release apt-transport-https wget curl nano vim locales -y \
&& apt auto-remove -y \
&& apt clean -y
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen
RUN apt-get update && apt-get install -y \
git \
python3-pip \
python3-dev \
libpq-dev \
libxml2-dev \
libxslt1-dev \
libffi-dev \
libyaml-dev \
build-essential \
libssl-dev \
libpq-dev
RUN git clone https://github.com/netbox-community/netbox.git /opt/netbox
WORKDIR /opt/netbox
RUN pip3 install --upgrade pip
RUN pip3 install -r requirements.txt
RUN apt-get remove -y git python3-dev build-essential libssl-dev libpq-dev
RUN apt-get autoremove -y
EXPOSE 8000
CMD ["python3", "netbox/manage.py", "runserver", "0.0.0.0:8000"]