No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

46 líneas
1.3KB

  1. FROM python:3.10-slim-bullseye
  2. LABEL maintainer="foo@bar.com"
  3. ARG TZ='Asia/Shanghai'
  4. # RUN echo /etc/apt/sources.list
  5. # RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
  6. RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
  7. # Set the timezone and configure tzdata
  8. # RUN apt-get update \
  9. # && apt-get install -y --no-install-recommends tzdata \
  10. # && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
  11. # && dpkg-reconfigure --frontend noninteractive tzdata \
  12. # && apt-get clean
  13. RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
  14. ENV BUILD_PREFIX=/app
  15. ADD . ${BUILD_PREFIX}
  16. RUN apt-get update \
  17. &&apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra\
  18. && cd ${BUILD_PREFIX} \
  19. && cp config-template.json config.json \
  20. && /usr/local/bin/python -m pip install --no-cache --upgrade pip \
  21. && pip install --no-cache -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  22. WORKDIR ${BUILD_PREFIX}
  23. ADD docker/entrypoint.sh /entrypoint.sh
  24. RUN chmod +x /entrypoint.sh \
  25. && mkdir -p /home/noroot \
  26. && groupadd -r noroot \
  27. && useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \
  28. && chown -R noroot:noroot /home/noroot ${BUILD_PREFIX} /usr/local/lib
  29. USER noroot
  30. ENTRYPOINT ["/entrypoint.sh"]