Debian Codegraph @

Dockerfile

raw
1 ARG PYTHON_VER
2
3 FROM python:${PYTHON_VER}-slim
4
5 # Install all OS package upgrades and dependencies needed to run Nautobot in production
6 # hadolint ignore=DL3005,DL3008,DL3013
7 RUN apt-get update && \
8 apt-get upgrade -y && \
9 apt-get install --no-install-recommends -y git mime-support curl libxml2 libmariadb3 openssl && \
10 apt-get autoremove -y && \
11 apt-get clean all && \
12 rm -rf /var/lib/apt/lists/* && \
13 pip --no-cache-dir install --upgrade pip wheel
14
15 RUN pip install --upgrade pip
16
17 RUN curl -sSL https://install.python-poetry.org -o /tmp/install-poetry.py && \
18 python /tmp/install-poetry.py --version 1.2.0 && \
19 rm -f /tmp/install-poetry.py
20
21 # Add poetry install location to the $PATH
22 ENV PATH="${PATH}:/root/.local/bin"
23
24 WORKDIR /local
25 COPY pyproject.toml poetry.lock /local/
26
27 RUN poetry config virtualenvs.create false \
28 && poetry install --no-interaction --no-ansi
29
30 # Do not break dependency caching before installing project
31 COPY . .
32 RUN poetry install