forked from clrxbl/blockgametracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (25 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
33
34
35
36
FROM python:3.9-alpine3.15 AS build-env
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1
RUN apk add --no-cache --virtual .python_deps build-base python3-dev libffi-dev bash && \
pip3 install poetry && \
apk add --no-cache git && \
apk del .python_deps && \
mkdir -p /app/src /app /shared && \
poetry config virtualenvs.create false
ADD pyproject.toml /app/pyproject.toml
WORKDIR /app
RUN poetry export --dev --without-hashes --no-interaction --no-ansi -f requirements.txt -o requirements.txt && \
pip install --prefix=/runtime --force-reinstall -r requirements.txt
ADD src /app/src
FROM gcr.io/distroless/python3-debian11
ENV PYTHONPATH=/usr/local/lib/python3.9/site-packages
COPY --from=build-env /runtime /usr/local
ADD src /app/src
WORKDIR /app
ENTRYPOINT python3 /app/src/blockgametracker/main.py