Skip to content

Commit

Permalink
more efficient Dockerfile maybe?; can't have new routines as commands…
Browse files Browse the repository at this point in the history
…! mistake
  • Loading branch information
Ereiarrus committed Feb 5, 2024
1 parent 8d9372a commit c4935ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
FROM python:3.12-alpine3.19
WORKDIR /complements-bot-py
ENV PYTHONPATH /complements-bot-py
COPY src ./src
COPY main.py .
RUN rm -rf ./src/test_complements_bot
RUN rm -rf ./src/test_app
RUN pip install pipenv
RUN apk update
RUN apk add gcc
Expand All @@ -16,9 +12,13 @@ RUN apk add libffi-dev
RUN apk add openssl-dev
RUN apk add cargo
RUN apk add build-base
RUN pip install cython
COPY src ./src
COPY main.py .
RUN rm -rf ./src/test_complements_bot
RUN rm -rf ./src/test_app
RUN cd ./src; pipenv install --system --deploy; cd ..
RUN rm -rf /var/cache/apk/*
RUN pip install cython
RUN python -m cython -3 --embed -o main.c main.py
RUN gcc -Os -I $(python3-config --includes | grep python3.12) -o main main.c -lpython3.12 -lpthread -lutil $(python3-config --libs)
CMD ["./main"]
2 changes: 0 additions & 2 deletions src/complements_bot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ async def addcomplement(self, ctx: commands.Context) -> None:
"""
await ComplementsBot.send_and_log(ctx, (await self.addcomplement_h(ctx)))

@commands.command(aliases=["addcomp"])
async def addcomplement_h(self, ctx: commands.Context) -> Optional[str]:
"""
addcomplement() helper
Expand Down Expand Up @@ -889,7 +888,6 @@ async def listcomplements(self, ctx: commands.Context) -> None:
custom_log("listcomplements() loop", ComplementsBot.SHOULD_LOG)
await ComplementsBot.send_and_log(ctx, msg)

@commands.command(aliases=["listcomps"])
async def listcomplements_h(self, ctx: commands.Context) -> Iterable[str]:
"""
listcomplements() helper
Expand Down

0 comments on commit c4935ca

Please sign in to comment.