-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
348 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ | |
__pycache__ | ||
*.egg-info | ||
/.direnv | ||
.envrc | ||
.pdm-python | ||
.pdm-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
FROM python:3.9 AS BUILDER | ||
# Because cryptg builds some native library | ||
# use multi-stage build reduce image size | ||
ARG PYTHON_BASE=3.9-slim | ||
FROM python:$PYTHON_BASE AS builder | ||
|
||
WORKDIR /app | ||
# 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 . /app | ||
# install dependencies and project into the local packages directory | ||
WORKDIR /project | ||
RUN pdm install --check --prod --no-editable | ||
|
||
RUN pip install \ | ||
--no-cache-dir \ | ||
--trusted-host pypi.python.org \ | ||
--disable-pip-version-check \ | ||
/app | ||
# run stage | ||
FROM python:$PYTHON_BASE | ||
|
||
FROM python:3.9-slim | ||
# 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"] | ||
|
||
RUN mkdir /usr/local/lib/python3.9 -p | ||
COPY --from=BUILDER \ | ||
/usr/local/lib/python3.9/site-packages \ | ||
/usr/local/lib/python3.9/site-packages | ||
|
||
ENTRYPOINT ["python", "-m", "tg_searcher"] | ||
CMD ["-f", "./config/searcher.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.