-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (28 loc) · 954 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
# Define base images and tags
# ---------------------------
ARG DOCKERFILE_BUILD_IMAGE="docker.io/python"
ARG DOCKERFILE_BUILD_TAG="3.10-slim-bullseye"
ARG DOCKERFILE_BASE_IMAGE="docker.io/python"
ARG DOCKERFILE_BASE_TAG="3.10-alpine3.15"
# Build env
# ---------
FROM $DOCKERFILE_BUILD_IMAGE:$DOCKERFILE_BUILD_TAG as build
ARG PIP_INDEX_URL=https://pypi.org/simple/
ARG PIP_INDEX=https://pypi.org/pypi/
ENV PATH "/app/.venv/bin:$PATH"
WORKDIR /app
COPY requirements.txt app.py ./
# Install latest whell and pip
# hadolint ignore=DL3013
RUN set -eux && \
python -m venv .venv && \
pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --upgrade wheel && \
pip install --no-cache-dir --upgrade --requirement requirements.txt
# Create image
# ----------------------
FROM $DOCKERFILE_BASE_IMAGE:$DOCKERFILE_BASE_TAG
WORKDIR /app
COPY --from=build /app /app
ENV PATH "/app/.venv/bin:$PATH"
ENTRYPOINT ["/app/app.py"]