您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

43 行
1.4KB

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