This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Dockerfile.local
51 lines (42 loc) · 1.68 KB
/
Dockerfile.local
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ARG ARCH=
FROM ${ARCH}python:3-slim-bullseye AS source
ARG VERSION=master
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /botamusique
RUN apt-get update && apt-get install -y git
RUN git clone --recurse-submodules https://github.com/azlux/botamusique.git . && git checkout $VERSION
FROM ${ARCH}python:3-slim-bullseye AS python-builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /botamusique
RUN apt-get update \
&& apt-get install -y gcc ffmpeg libjpeg-dev libmagic-dev opus-tools zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=source /botamusique .
RUN python3 -m venv venv \
&& venv/bin/pip install wheel \
&& venv/bin/pip install -r requirements.txt
FROM ${ARCH}node:14-bullseye-slim AS node-builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /botamusique/web
COPY --from=source /botamusique/web .
RUN npm install
RUN npm run build
FROM ${ARCH}python:3-slim-bullseye AS template-builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /botamusique
COPY --from=python-builder /botamusique .
COPY --from=node-builder /botamusique/templates templates
RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/web/templates
FROM ${ARCH}python:3-slim-bullseye
ENV DEBIAN_FRONTEND=noninteractive
EXPOSE 8181
WORKDIR /botamusique
RUN apt-get update \
&& apt-get install -y ffmpeg libmagic-dev opus-tools zlib1g \
&& rm -rf /var/lib/apt/lists/*
COPY --from=python-builder /botamusique .
COPY --from=node-builder /botamusique/static static
COPY --from=template-builder /botamusique/templates templates
RUN chmod +x entrypoint.sh
ENTRYPOINT [ "/botamusique/entrypoint.sh" ]
CMD ["/botamusique/venv/bin/python", "/botamusique/mumbleBot.py"]