diff options
author | Mole Shang <[email protected]> | 2024-05-13 21:31:08 +0800 |
---|---|---|
committer | Mole Shang <[email protected]> | 2024-05-13 21:31:08 +0800 |
commit | ff08e56b25206f3344db8fb28e736085d2998079 (patch) | |
tree | 8d285ff09ee1b0b220b390fabe2cf21eebdb71b9 | |
parent | d5a1125b6b86e1fe4e8fb6819b69b985cae70f84 (diff) | |
download | ATRI-ff08e56b25206f3344db8fb28e736085d2998079.tar.gz ATRI-ff08e56b25206f3344db8fb28e736085d2998079.tar.bz2 ATRI-ff08e56b25206f3344db8fb28e736085d2998079.zip |
use faster poetry docker image
-rw-r--r-- | Dockerfile | 31 |
1 files changed, 3 insertions, 28 deletions
@@ -1,33 +1,8 @@ -FROM sunpeek/poetry:py3.10-slim as base -# python -ENV PYTHONUNBUFFERED=1 \ - # prevents python creating .pyc files - PYTHONDONTWRITEBYTECODE=1 \ - \ - POETRY_VERSION=1.1.4 \ - # make poetry install to this location - POETRY_HOME="/opt/poetry" \ - POETRY_VIRTUALENVS_IN_PROJECT=true \ - POETRY_NO_INTERACTION=1 \ - \ - # paths - # this is where our requirements + virtual environment will live - PYSETUP_PATH="/opt/pysetup" \ - VENV_PATH="/opt/pysetup/.venv" - -# prepend poetry and venv to path -ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" - -FROM base as base-builder -WORKDIR $PYSETUP_PATH -ADD ./poetry.lock ./pyproject.toml ./ -RUN poetry install - -FROM base as pre-production +FROM getflow/python-poetry:stable-python3.10 EXPOSE 20000 -COPY --from=base-builder $VENV_PATH /app/.venv/ COPY . /app/ VOLUME /app/accounts /app/data WORKDIR /app +RUN $POETRY_HOME/bin/poetry config virtualenvs.create false && pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple && $POETRY_HOME/bin/poetry install --no-interaction --no-root --only main --no-ansi -CMD poetry run python3 main.py
\ No newline at end of file +CMD python3 main.py |