docker
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -1,11 +1,22 @@
|
||||
FROM python:latest
|
||||
FROM python:3.12.2-slim-bookworm as builder
|
||||
LABEL authors="bacon"
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt /app
|
||||
RUN apk add ffmpeg
|
||||
RUN python3 -m venv venv/
|
||||
CMD source venv/bin/activate
|
||||
RUN pip install -r requirements.txt
|
||||
RUN apt-get update \
|
||||
&& apt-get --no-install-recommends install ffmpeg -y \
|
||||
&& apt-get clean autoclean \
|
||||
&&pip wheel install \
|
||||
--no-cache-dir \
|
||||
--no-deps --wheel-dir /app/wheels \
|
||||
-r requirements.txt
|
||||
|
||||
FROM python:3.12.2-slim-bookworm as runner
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/wheels /wheels
|
||||
COPY --from=builder /usr/bin/ffmpeg /usr/bin/ffmpeg
|
||||
RUN pip install --no-cache /wheels/*
|
||||
|
||||
COPY src/ /app
|
||||
ENTRYPOINT ["python", "bot.py"]
|
||||
|
||||
Reference in New Issue
Block a user