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.

39 lines
1.1KB

  1. FROM python:3.7.9-alpine
  2. LABEL maintainer="foo@bar.com"
  3. ARG TZ='Asia/Shanghai'
  4. ARG CHATGPT_ON_WECHAT_VER=1.0.0
  5. ENV BUILD_PREFIX=/app \
  6. BUILD_OPEN_AI_API_KEY='YOUR OPEN AI KEY HERE'
  7. RUN apk add --no-cache \
  8. curl \
  9. wget \
  10. openssh
  11. RUN wget -t 3 -T 30 -nv -O chatgpt-on-wechat-${CHATGPT_ON_WECHAT_VER}.tar.gz \
  12. https://github.com/zhayujie/chatgpt-on-wechat/archive/refs/tags/${CHATGPT_ON_WECHAT_VER}.tar.gz \
  13. && tar -xzf chatgpt-on-wechat-${CHATGPT_ON_WECHAT_VER}.tar.gz \
  14. && mv chatgpt-on-wechat-${CHATGPT_ON_WECHAT_VER} ${BUILD_PREFIX} \
  15. && rm chatgpt-on-wechat-${CHATGPT_ON_WECHAT_VER}.tar.gz
  16. WORKDIR ${BUILD_PREFIX}
  17. RUN cd ${BUILD_PREFIX} \
  18. && cp config-template.json ${BUILD_PREFIX}/config.json \
  19. && sed -i "2s/YOUR API KEY/${BUILD_OPEN_AI_API_KEY}/" ${BUILD_PREFIX}/config.json \
  20. && cat ${BUILD_PREFIX}/config.json
  21. RUN /usr/local/bin/python -m pip install --upgrade pip \
  22. && pip install itchat-uos==1.5.0.dev0 \
  23. && pip install --upgrade openai
  24. RUN adduser -D -h /home/noroot -u 1000 -s /bin/bash noroot \
  25. && chown noroot:noroot ${BUILD_PREFIX}
  26. USER noroot
  27. CMD ["python","app.py"]