Skip to content

Commit

Permalink
switch to pdm package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ropc committed Mar 2, 2024
1 parent 33f1f4a commit fe2c816
Show file tree
Hide file tree
Showing 5 changed files with 1,586 additions and 2,165 deletions.
28 changes: 21 additions & 7 deletions Dockerfile
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" ]
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ services:
meme-bot:
env_file:
- debug.env
command: [ "bot-debug" ]
command: [ "memebot.memebot", "run_debug" ]
ports:
- "5678:5678"
Loading

0 comments on commit fe2c816

Please sign in to comment.