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"
|
LABEL authors="bacon"
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY requirements.txt /app
|
COPY requirements.txt /app
|
||||||
RUN apk add ffmpeg
|
RUN apt-get update \
|
||||||
RUN python3 -m venv venv/
|
&& apt-get --no-install-recommends install ffmpeg -y \
|
||||||
CMD source venv/bin/activate
|
&& apt-get clean autoclean \
|
||||||
RUN pip install -r requirements.txt
|
&&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
|
COPY src/ /app
|
||||||
ENTRYPOINT ["python", "bot.py"]
|
ENTRYPOINT ["python", "bot.py"]
|
||||||
|
|||||||
Reference in New Issue
Block a user