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.

55 lines
1.8 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.2
  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. ARG APT_CACHE=
  10. ENV DEBIAN_FRONTEND=noninteractive
  11. WORKDIR /botamusique
  12. RUN echo "${APT_CACHE}" >> /etc/apt/apt.conf.d/01prox
  13. RUN apt-get update \
  14. && apt-get install -y gcc ffmpeg libjpeg-dev libmagic-dev opus-tools zlib1g-dev \
  15. && rm -rf /var/lib/apt/lists/*
  16. COPY --from=source /botamusique .
  17. RUN python3 -m venv venv \
  18. && venv/bin/pip install wheel \
  19. && venv/bin/pip install -r requirements.txt
  20. FROM ${ARCH}node:14-buster-slim AS node-builder
  21. ENV DEBIAN_FRONTEND=noninteractive
  22. WORKDIR /botamusique/web
  23. COPY --from=source /botamusique/web .
  24. RUN npm install
  25. RUN npm run build
  26. FROM ${ARCH}python:3-slim-buster AS template-builder
  27. ENV DEBIAN_FRONTEND=noninteractive
  28. WORKDIR /botamusique
  29. COPY --from=python-builder /botamusique .
  30. COPY --from=node-builder /botamusique/templates templates
  31. RUN venv/bin/python scripts/translate_templates.py --lang-dir /botamusique/lang --template-dir /botamusique/templates
  32. FROM ${ARCH}python:3-slim-buster
  33. ARG APT_CACHE=
  34. ENV DEBIAN_FRONTEND=noninteractive
  35. EXPOSE 8181
  36. WORKDIR /botamusique
  37. RUN echo "${APT_CACHE}" >> /etc/apt/apt.conf.d/01prox
  38. RUN apt-get update \
  39. && apt-get install -y ffmpeg libmagic-dev opus-tools zlib1g \
  40. && rm -rf /var/lib/apt/lists/*
  41. COPY --from=python-builder /botamusique .
  42. COPY --from=node-builder /botamusique/static static
  43. COPY --from=template-builder /botamusique/templates templates
  44. RUN chmod +x entrypoint.sh
  45. ENTRYPOINT [ "/botamusique/entrypoint.sh" ]
  46. CMD ["/botamusique/venv/bin/python", "/botamusique/mumbleBot.py"]