From ce34198e8dd8ce259695cdb510bb11f10a62376b Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Wed, 23 Nov 2022 13:59:47 +0330 Subject: WIP --- Dockerfile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f33b3fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM python:3.11.0-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 \ + POETRY_HOME="/poetry" \ + POETRY_VIRTUALENVS_IN_PROJECT=true \ + POETRY_NO_INTERACTION=1 \ + PYSETUP_PATH="/devourer" \ + VENV_PATH="/devourer/.venv" +ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" + +FROM python-base as builder-base +ENV POETRY_VERSION=1.2.2 +RUN apt update && apt install -y --no-install-recommends curl build-essential +RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python +WORKDIR $PYSETUP_PATH +COPY ./pyproject.toml ./ +RUN poetry install --no-dev + +FROM python-base as production +COPY --from=builder-base $VENV_PATH $VENV_PATH +COPY ./magni.py $PYSETUP_PATH/magni.py +WORKDIR $PYSETUP_PATH +ENTRYPOINT $PYSETUP_PATH/magni.py -- cgit v1.2.3