From 56fa2eca251cb70294cd78c68784166ab83f9e26 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 22 Aug 2023 20:34:12 +0200 Subject: [PATCH] Activate venv without poetry --- Dockerfile | 15 +++++++++++---- docker/docker-entrypoint.sh | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 240054b..94dbea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,9 @@ ENV PATH="${POETRY_HOME}/bin:${PATH}" WORKDIR ${APP_PATH} COPY ./poetry.lock ./pyproject.toml ./README.md ./ +WORKDIR ${APP_PATH} +RUN poetry install + # -------------- FROM staging as worker @@ -37,15 +40,19 @@ ENV APP_NAME=${APP_NAME} ENV APP_PATH=${APP_PATH} ENV VERBANOTE_OUTPUT_PATH=${VERBANOTE_OUTPUT_PATH} ENV VERBANOTE_INPUT_PATH=${VERBANOTE_INPUT_PATH} +ENV VIRTUAL_ENV="${APP_PATH}/.venv" +ENV PATH="${APP_PATH}/.venv/bin:${PATH}" + +COPY --from=staging ${APP_PATH} ${APP_PATH} RUN mkdir -p ${VERBANOTE_INPUT_PATH} RUN mkdir -p ${VERBANOTE_OUTPUT_PATH} -WORKDIR ${APP_PATH} -RUN poetry install - # installing the large models -RUN poetry run ltt install --pytorch-computation-backend=cu118 torch torchvision torchaudio +RUN rm "${VIRTUAL_ENV}/bin/python" +RUN ln -s "/opt/conda/bin/python" "${VIRTUAL_ENV}/bin/python" +RUN which python +RUN ltt install --pytorch-computation-backend=cu117 torch torchvision torchaudio COPY ./${APP_NAME} ./${APP_NAME} diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index a6a2262..1c0d37f 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -2,4 +2,4 @@ # set -e -exec poetry run "$@" +exec "$@"