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.

Dockerfile.latest 1.2KB

1 개월 전
123456789101112131415161718192021222324252627282930313233343536373839404142
  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. ENV BUILD_PREFIX=/app
  14. ADD . ${BUILD_PREFIX}
  15. RUN apt-get update \
  16. &&apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra\
  17. && cd ${BUILD_PREFIX} \
  18. && cp config-template.json config.json \
  19. && /usr/local/bin/python -m pip install --no-cache --upgrade pip \
  20. && pip install --no-cache -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
  21. WORKDIR ${BUILD_PREFIX}
  22. ADD docker/entrypoint.sh /entrypoint.sh
  23. RUN chmod +x /entrypoint.sh \
  24. && mkdir -p /home/noroot \
  25. && groupadd -r noroot \
  26. && useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \
  27. && chown -R noroot:noroot /home/noroot ${BUILD_PREFIX} /usr/local/lib
  28. USER noroot
  29. ENTRYPOINT ["/entrypoint.sh"]