Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

45 lines
1.2KB

  1. FROM python:3.10-slim-bullseye
  2. LABEL maintainer="foo@bar.com"
  3. ARG TZ='Asia/Shanghai'
  4. ARG CHATGPT_ON_WECHAT_VER
  5. # RUN echo /etc/apt/sources.list
  6. # RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
  7. RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
  8. # Set the timezone and configure tzdata
  9. RUN apt-get update \
  10. && apt-get install -y --no-install-recommends tzdata \
  11. && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
  12. && dpkg-reconfigure --frontend noninteractive tzdata \
  13. && apt-get clean
  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
  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"]