diff --git a/Dockerfile b/Dockerfile index 706fdf470..990df4cfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,4 @@ ENV PATH="/opt/venv/bin:$PATH" COPY . . # 启动应用 -CMD ["python", "app.py"] \ No newline at end of file +CMD ["./entrypoint-api.sh"] \ No newline at end of file diff --git a/entrypoint-api.sh b/entrypoint-api.sh new file mode 100755 index 000000000..043a27569 --- /dev/null +++ b/entrypoint-api.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# 检查 asr-models/SenseVoiceSmall 目录是否存在 +if [ ! -d "asr-models/SenseVoiceSmall" ]; then + # 如果目录不存在,执行下载脚本 + python modelscope_model_download.py +fi + +# 执行 app.py +python app.py +