-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
30 lines (21 loc) · 903 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.9-slim-buster AS build
COPY / /opt/ytpmvbot/
WORKDIR /opt/ytpmvbot
# install lsb_release to prevent pip from erroring
RUN apt-get update && apt-get install lsb-release -y --no-install-recommends && \
\
rm -rf /var/lib/apt/lists/* && \
pip install --user --no-cache-dir -r requirements.txt && \
chmod +x /opt/ytpmvbot/*.sh && \
apt-get -y purge --auto-remove lsb-release
FROM python:3.9-slim-buster AS app
COPY --from=build /root/.local /root/.local
COPY --from=build /opt/ytpmvbot /opt/ytpmvbot
WORKDIR /opt/ytpmvbot
RUN apt-get update && apt-get install ffmpeg -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
ENV PATH=/root/.local/bin:$PATH
HEALTHCHECK --interval=2m --timeout=1s \
CMD [ "/opt/ytpmvbot/healthcheck.sh" ]
ENTRYPOINT [ "/opt/ytpmvbot/docker-entrypoint.sh" ]
CMD [ "python", "ytpmv.py", "||", "echo 'Bot exited with error'" ]