-
Notifications
You must be signed in to change notification settings - Fork 52
/
Dockerfile
32 lines (24 loc) · 992 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
ARG PYTHON_VER
FROM python:${PYTHON_VER}-slim
# Install all OS package upgrades and dependencies needed to run Nautobot in production
# hadolint ignore=DL3005,DL3008,DL3013
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y git mime-support curl libxml2 libmariadb3 openssl && \
apt-get autoremove -y && \
apt-get clean all && \
rm -rf /var/lib/apt/lists/* && \
pip --no-cache-dir install --upgrade pip wheel
RUN pip install --upgrade pip
RUN curl -sSL https://install.python-poetry.org -o /tmp/install-poetry.py && \
python /tmp/install-poetry.py --version 1.6.0 && \
rm -f /tmp/install-poetry.py
# Add poetry install location to the $PATH
ENV PATH="${PATH}:/root/.local/bin"
WORKDIR /local
COPY pyproject.toml poetry.lock /local/
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Do not break dependency caching before installing project
COPY . .
RUN poetry install