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.

35 lines
942B

  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. COPY chatgpt-on-wechat.tar.gz ./chatgpt-on-wechat.tar.gz
  8. RUN apk add --no-cache \
  9. bash \
  10. && tar -xf chatgpt-on-wechat.tar.gz \
  11. && mv chatgpt-on-wechat ${BUILD_PREFIX} \
  12. && cd ${BUILD_PREFIX} \
  13. && cp config-template.json ${BUILD_PREFIX}/config.json \
  14. && sed -i "2s/YOUR API KEY/${BUILD_OPEN_AI_API_KEY}/" ${BUILD_PREFIX}/config.json \
  15. && /usr/local/bin/python -m pip install --no-cache --upgrade pip \
  16. && pip install --no-cache \
  17. itchat-uos==1.5.0.dev0 \
  18. openai
  19. WORKDIR ${BUILD_PREFIX}
  20. ADD ./entrypoint.sh /entrypoint.sh
  21. RUN chmod +x /entrypoint.sh \
  22. && adduser -D -h /home/noroot -u 1000 -s /bin/bash noroot \
  23. && chown noroot:noroot ${BUILD_PREFIX}
  24. USER noroot
  25. ENTRYPOINT ["/entrypoint.sh"]