-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 704 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 704 Bytes
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
FROM python:3.11-slim-buster as python-base
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100
ENV PATH="/opt/venv/bin:$PATH"
FROM python-base as builder-base
RUN apt-get update \
&& apt-get install -y gcc git
RUN python -m venv /opt/venv
COPY ./requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir setuptools wheel \
&& pip install --no-cache-dir -r requirements.txt
FROM python-base as production
COPY --from=builder-base /opt/venv /opt/venv
RUN apt-get update && apt-get install -y curl
WORKDIR /app
COPY ./src /app/src
CMD ["python", "-m", "src"]