Skip to content

Commit

Permalink
activate venv
Browse files Browse the repository at this point in the history
  • Loading branch information
hollanbm committed Sep 21, 2024
1 parent db84a5e commit 859b5a6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ENV POETRY_NO_INTERACTION=1 \
RUN --mount=type=cache,target=/tmp/poetry_cache poetry install --only main --no-root
RUN poetry install

# switch to fresh layer, without poetry
FROM python:3.12-slim-bookworm AS app

# update base os
Expand All @@ -29,11 +28,10 @@ RUN apt-get update -y -qq && \

WORKDIR /home/app/renamarr

# venv from builder
COPY --from=builder /home/app/renamarr/.venv /home/app/renamarr/.venv
# venv
COPY --from=builder /home/app/renamarr/.venv .venv

# app src
COPY src /home/app/renamarr/src
COPY src src

# setup user, bash default shell
RUN useradd app -m -s /bin/bash
Expand All @@ -47,7 +45,8 @@ USER app
ENV LOGURU_DIAGNOSE="NO"
ENV LOGURU_LEVEL="INFO"

# activate venv
RUN source /home/app/renamarr/.venv/bin/activate
# "activate" venv
ENV PATH="/home/app/renamarr/.venv/bin:$PATH"

ENTRYPOINT [ "python", "src/main.py"]
ENTRYPOINT ["/bin/bash", "-c"]
CMD [ "python", "src/main.py"]

0 comments on commit 859b5a6

Please sign in to comment.