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.

37 lines
1.2 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. FROM python:3-alpine AS source
  2. ARG VERSION=7.1
  3. WORKDIR /app
  4. RUN apk add --no-cache git
  5. RUN git clone --recurse-submodules https://github.com/azlux/botamusique.git . && git checkout $VERSION
  6. FROM python:3-alpine AS python-builder
  7. WORKDIR /app
  8. COPY --from=source /app .
  9. RUN apk add --no-cache ffmpeg-dev gcc git jpeg-dev musl-dev zlib-dev
  10. RUN python3 -m venv venv \
  11. && venv/bin/pip install wheel opuslib protobuf \
  12. && venv/bin/pip install -r requirements.txt
  13. RUN chmod +x entrypoint.sh
  14. FROM node:14-alpine AS node-builder
  15. WORKDIR /app/web
  16. COPY --from=source /app/web .
  17. RUN npm install \
  18. && npm run build
  19. FROM python:3-alpine
  20. ENV BAM_CONFIG_file="/app/configuration.ini"
  21. ENV BAM_CERTIFICATE="/app/botamusique.pem"
  22. ENV BAM_DB="/data/data.db"
  23. ENV BAM_MUSIC_DB="/data/music.db"
  24. WORKDIR /app
  25. COPY --from=python-builder /app .
  26. COPY --from=node-builder /app/static static
  27. COPY --from=node-builder /app/templates templates
  28. RUN apk add --no-cache bash gcc ffmpeg libmagic opus-dev
  29. RUN venv/bin/python scripts/translate_templates.py --lang-dir /app/lang --template-dir /app/templates
  30. ENTRYPOINT [ "/app/entrypoint.sh" ]
  31. CMD ["/app/venv/bin/python", "/app/mumbleBot.py"]