Skip to content

Commit

Permalink
fix: docker image entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed May 14, 2024
1 parent a41aa20 commit 0b7c87a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ FROM python:$PYTHON_BASE AS builder
# install PDM
RUN pip install -U pdm
ENV PDM_CHECK_UPDATE=false
COPY pyproject.toml pdm.lock README.md /project/
COPY tg_searcher /project/tg_searcher
COPY pyproject.toml pdm.lock README.md /app/
COPY tg_searcher /app/tg_searcher

# install dependencies and project into the local packages directory
WORKDIR /project
WORKDIR /app
RUN pdm install --check --prod --no-editable

# run stage
FROM python:$PYTHON_BASE

# retrieve packages from build stage
COPY --from=builder /project/.venv/ /project/.venv
ENV PATH="/project/.venv/bin:$PATH"
COPY tg_searcher /project/tg_searcher
WORKDIR /project
CMD ["python", "tg_searcher/__main__.py"]
COPY --from=builder /app/.venv/ /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
COPY tg_searcher /app/tg_searcher
WORKDIR /app
ENTRYPOINT ["python", "tg_searcher/__main__.py"]
CMD ["-f", "./config/searcher.yaml"]

0 comments on commit 0b7c87a

Please sign in to comment.