Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

39 lines
1.2KB

  1. FROM python:3.10-alpine
  2. LABEL maintainer="foo@bar.com"
  3. ARG TZ='Asia/Shanghai'
  4. ARG CHATGPT_ON_WECHAT_VER
  5. ENV BUILD_PREFIX=/app
  6. RUN apk add --no-cache \
  7. bash \
  8. curl \
  9. wget \
  10. && export BUILD_GITHUB_TAG=${CHATGPT_ON_WECHAT_VER:-`curl -sL "https://api.github.com/repos/zhayujie/chatgpt-on-wechat/releases/latest" | \
  11. grep '"tag_name":' | \
  12. sed -E 's/.*"([^"]+)".*/\1/'`} \
  13. && wget -t 3 -T 30 -nv -O chatgpt-on-wechat-${BUILD_GITHUB_TAG}.tar.gz \
  14. https://github.com/zhayujie/chatgpt-on-wechat/archive/refs/tags/${BUILD_GITHUB_TAG}.tar.gz \
  15. && tar -xzf chatgpt-on-wechat-${BUILD_GITHUB_TAG}.tar.gz \
  16. && mv chatgpt-on-wechat-${BUILD_GITHUB_TAG} ${BUILD_PREFIX} \
  17. && rm chatgpt-on-wechat-${BUILD_GITHUB_TAG}.tar.gz \
  18. && cd ${BUILD_PREFIX} \
  19. && cp config-template.json ${BUILD_PREFIX}/config.json \
  20. && /usr/local/bin/python -m pip install --no-cache --upgrade pip \
  21. && pip install --no-cache -r requirements.txt \
  22. && apk del curl wget
  23. WORKDIR ${BUILD_PREFIX}
  24. ADD ./entrypoint.sh /entrypoint.sh
  25. RUN chmod +x /entrypoint.sh \
  26. && adduser -D -h /home/noroot -u 1000 -s /bin/bash noroot \
  27. && chown -R noroot:noroot ${BUILD_PREFIX}
  28. USER noroot
  29. ENTRYPOINT ["/entrypoint.sh"]