Activate venv without poetry

This commit is contained in:
Marty Oehme 2023-08-22 20:34:12 +02:00
parent 64123a29e0
commit 56fa2eca25
Signed by: Marty
GPG Key ID: EDBF2ED917B2EF6A
2 changed files with 12 additions and 5 deletions

View File

@ -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}

View File

@ -2,4 +2,4 @@
#
set -e
exec poetry run "$@"
exec "$@"