From f3a073febc89896724d964af3f69e285c7dc5362 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Mon, 12 Oct 2020 22:22:02 -0500 Subject: [PATCH] Fix 7.x series --- Dockerfile | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a14b63..345b266 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,35 @@ -FROM python:3-alpine - +FROM python:3-alpine AS source ARG VERSION=7.1 +WORKDIR /app +RUN apk add --no-cache git +RUN git clone --recurse-submodules https://github.com/azlux/botamusique.git . && git checkout $VERSION + +FROM python:3-alpine AS python-builder WORKDIR /app +COPY --from=source /app . +RUN apk add --no-cache ffmpeg-dev gcc git jpeg-dev musl-dev opus-dev zlib-dev +RUN python3 -m venv venv \ + && venv/bin/pip install wheel opuslib protobuf \ + && venv/bin/pip install -r requirements.txt +RUN chmod +x entrypoint.sh + + +FROM node:14-alpine AS node-builder +WORKDIR /app/web +COPY --from=source /app/web . +RUN npm install \ + && npm run build -RUN apk add --no-cache git ffmpeg-dev zlib-dev jpeg-dev gcc musl-dev -RUN git clone --recurse-submodules https://github.com/azlux/botamusique.git . && git checkout $VERSION -RUN cp web/templates/index.template.html web/templates/index.en_US.html -RUN python3 -m venv venv -RUN venv/bin/pip install wheel opuslib protobuf -RUN venv/bin/pip install -r requirements.txt FROM python:3-alpine +ENV BAM_CONFIG_file="/app/configuration.ini" +ENV BAM_CERTIFICATE="/app/botamusique.pem" WORKDIR /app -COPY --from=0 /app . -RUN apk add --no-cache gcc opus-dev libmagic ffmpeg -ENTRYPOINT ["/app/venv/bin/python", "/app/mumbleBot.py"] +COPY --from=python-builder /app . +COPY --from=node-builder /app/static static +COPY --from=node-builder /app/templates templates +RUN apk add --no-cache bash libmagic ffmpeg +RUN venv/bin/python scripts/translate_templates.py --lang-dir /app/lang --template-dir /app/templates +ENTRYPOINT [ "/app/entrypoint.sh" ] +CMD ["/app/venv/bin/python", "/app/mumbleBot.py"]