Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

Dockerfile.alpine 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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"]