-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
1,586 additions
and
2,165 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
FROM python:3.10-slim-buster | ||
# build stage | ||
FROM python:3.12 AS builder | ||
|
||
# install PDM | ||
RUN pip install -U pip setuptools wheel | ||
RUN pip install pdm | ||
|
||
WORKDIR /project | ||
# copy files | ||
COPY pyproject.toml pdm.lock /project/ | ||
RUN mkdir __pypackages__ && pdm sync --prod --no-editable | ||
|
||
# run stage | ||
FROM python:3.12 | ||
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/* | ||
RUN pip install poetry==1.3.1 | ||
WORKDIR /tmp/meme-bot | ||
COPY poetry.lock pyproject.toml ./ | ||
RUN poetry export -f requirements.txt > requirements.txt && poetry run pip install -vvv -r requirements.txt | ||
ENV PYTHONPATH=/project/pkgs | ||
COPY --from=builder /project/__pypackages__/3.12/lib /project/pkgs | ||
# retrieve executables | ||
COPY --from=builder /project/__pypackages__/3.12/bin/* /bin/ | ||
WORKDIR /project | ||
COPY fonts/* /usr/share/fonts/truetype/ | ||
COPY assets ./assets | ||
COPY tests ./tests | ||
COPY meme_generator ./meme_generator | ||
COPY memebot ./memebot | ||
ENTRYPOINT [ "poetry", "run" ] | ||
CMD [ "bot" ] | ||
|
||
ENTRYPOINT [ "python", "-m" ] | ||
CMD [ "memebot.memebot", "run" ] |
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.