Procházet zdrojové kódy

update Readme.md

master
lanvent před 1 rokem
rodič
revize
a68af990ea
2 změnil soubory, kde provedl 39 přidání a 0 odebrání
  1. +7
    -0
      README.md
  2. +32
    -0
      docker/Dockerfile.debian.latest

+ 7
- 0
README.md Zobrazit soubor

@@ -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` 文件:


+ 32
- 0
docker/Dockerfile.debian.latest Zobrazit soubor

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

Načítá se…
Zrušit
Uložit