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.

51 lines
1.5KB

  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. RUN apt-get install -y --no-install-recommends tzdata \
  15. && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
  16. && dpkg-reconfigure --frontend noninteractive tzdata \
  17. && apt-get clean
  18. ENV BUILD_PREFIX=/app
  19. ADD . ${BUILD_PREFIX}
  20. # RUN apt-get update \
  21. # &&apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra\
  22. # && cd ${BUILD_PREFIX} \
  23. # && cp config-template.json config.json \
  24. # && /usr/local/bin/python -m pip install --no-cache --upgrade pip \
  25. # && pip install --no-cache -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  26. WORKDIR ${BUILD_PREFIX}
  27. ADD docker/entrypoint.sh /entrypoint.sh
  28. RUN chmod +x /entrypoint.sh \
  29. && mkdir -p /home/noroot \
  30. && groupadd -r noroot \
  31. && useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \
  32. && chown -R noroot:noroot /home/noroot ${BUILD_PREFIX} /usr/local/lib
  33. USER noroot
  34. ENTRYPOINT ["/entrypoint.sh"]