diff --git a/README.md b/README.md index 333ceb5..2311330 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,13 @@ pip3 install -r requirements.txt 参考[#415](https://github.com/zhayujie/chatgpt-on-wechat/issues/415) +使用`azure`语音功能需安装: +```bash +pip install azure-cognitiveservices-speech +``` +> 目前默认发布的镜像和`railway`部署,都基于`apline`,无法安装`azure`的依赖。若有需求请自行基于`debian`打包。 +参考[文档](https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/quickstarts/setup-platform?pivots=programming-language-python&tabs=linux%2Cubuntu%2Cdotnet%2Cjre%2Cmaven%2Cnodejs%2Cmac%2Cpypi) + ## 配置 配置文件的模板在根目录的`config-template.json`中,需复制该模板创建最终生效的 `config.json` 文件: diff --git a/docker/Dockerfile.debian.latest b/docker/Dockerfile.debian.latest new file mode 100644 index 0000000..6e5a3fe --- /dev/null +++ b/docker/Dockerfile.debian.latest @@ -0,0 +1,32 @@ +FROM python:3.10-slim + +LABEL maintainer="foo@bar.com" +ARG TZ='Asia/Shanghai' + +ARG CHATGPT_ON_WECHAT_VER + +ENV BUILD_PREFIX=/app + +ADD . ${BUILD_PREFIX} + +RUN apt-get update \ + &&apt-get install -y --no-install-recommends bash \ + ffmpeg espeak \ + && cd ${BUILD_PREFIX} \ + && cp config-template.json config.json \ + && /usr/local/bin/python -m pip install --no-cache --upgrade pip \ + && pip install --no-cache -r requirements.txt \ + && pip install azure-cognitiveservices-speech + +WORKDIR ${BUILD_PREFIX} + +ADD docker/entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh \ + && groupadd -r noroot \ + && useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \ + && chown -R noroot:noroot ${BUILD_PREFIX} + +USER noroot + +ENTRYPOINT ["docker/entrypoint.sh"] \ No newline at end of file