-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
35 lines (24 loc) · 918 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
34
35
FROM python:3.12.4-slim-bookworm as build
RUN set -x \
&& python3 -m venv /opt/conveyor
ENV PATH="/opt/conveyor/bin:${PATH}"
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
set -x \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential
COPY requirements.txt /tmp/requirements.txt
RUN --mount=type=cache,target=/root/.cache/pip \
set -x \
&& pip --no-cache-dir --disable-pip-version-check \
install -r /tmp/requirements.txt
FROM python:3.12.4-slim-bookworm
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONPATH /opt/conveyor/src/
ENV PATH="/opt/conveyor/bin:${PATH}"
WORKDIR /opt/conveyor/src/
COPY --from=build /opt/conveyor/ /opt/conveyor/
COPY . /opt/conveyor/src/