-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
38 lines (28 loc) · 891 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
37
38
# BASE
FROM python:3.10-alpine as python-base
ENV APP_NAME="graphinder" \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
PIP_NO_CACHE_DIR=off \
PYSETUP_PATH="/opt/pysetup" \
PYTHONDONTWRITEBYTECODE=1 \
VENV_PATH="/opt/pysetup/.venv" \
PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
# BUILDER
FROM python-base as builder-base
WORKDIR $PYSETUP_PATH
RUN apk add build-base zlib-dev libffi-dev
RUN pip install poetry
COPY ./poetry.lock ./pyproject.toml ./README.md ./
RUN poetry install --no-dev --no-root
COPY ./$APP_NAME ./$APP_NAME
RUN poetry install --no-dev
# RELEASE
FROM python-base as release
ENV PYTHONWARNINGS="ignore"
COPY --from=builder-base $VENV_PATH $VENV_PATH
COPY ./$APP_NAME /$APP_NAME/
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT /docker-entrypoint.sh $0 $@
CMD ["-h"]