You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
  1. ARG ARCH=
  2. FROM ${ARCH}python:3-slim-buster AS source
  3. ARG VERSION=7.1
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. WORKDIR /botamusique
  6. RUN apt-get update && apt-get install -y git
  7. RUN git clone --recurse-submodules https://github.com/azlux/botamusique.git . && git checkout $VERSION
  8. FROM ${ARCH}python:3-slim-buster AS python-builder
  9. ENV DEBIAN_FRONTEND=noninteractive
  10. WORKDIR /botamusique
  11. RUN apt-get update \
  12. && apt-get install -y gcc ffmpeg libjpeg-dev libmagic-dev opus-tools zlib1g-dev \
  13. && rm -rf /var/lib/apt/lists/*
  14. COPY --from=source /botamusique .
  15. RUN python3 -m venv venv \
  16. && venv/bin/pip install wheel \
  17. && venv/bin/pip install -r requirements.txt
  18. FROM ${ARCH}node:14-buster-slim AS node-builder
  19. ENV DEBIAN_FRONTEND=noninteractive
  20. WORKDIR /botamusique/web
  21. COPY --from=source /botamusique/web .
  22. RUN npm install
  23. RUN npm run build
  24. FROM ${ARCH}python:3-slim-buster AS template-builder
  25. ENV DEBIAN_FRONTEND=noninteractive
  26. WORKDIR /botamusique
  27. COPY --from=python-builder /botamusique .
  28. COPY --from=node-builder /botamusique/templates templates
  29. RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/templates
  30. FROM ${ARCH}python:3-slim-buster
  31. ENV DEBIAN_FRONTEND=noninteractive
  32. EXPOSE 8181
  33. WORKDIR /botamusique
  34. RUN apt-get update \
  35. && apt-get install -y ffmpeg libmagic-dev opus-tools zlib1g \
  36. && rm -rf /var/lib/apt/lists/*
  37. COPY --from=python-builder /botamusique .
  38. COPY --from=node-builder /botamusique/static static
  39. COPY --from=template-builder /botamusique/templates templates
  40. RUN chmod +x entrypoint.sh
  41. ENTRYPOINT [ "/botamusique/entrypoint.sh" ]
  42. CMD ["/botamusique/venv/bin/python", "/botamusique/mumbleBot.py"]