Spaces:
Runtime error
Runtime error
Download Dockerfile from Mahiruoshi/Bert-vits2-api: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/spaces/Mahiruoshi/Bert-vits2-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Mahiruoshi/Bert-vits2-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Mahiruoshi/Bert-vits2-api/resolve/main/Dockerfile
752 Bytes
| # 使用 continuumio/miniconda3 作为基础镜像 | |
| FROM continuumio/miniconda3 | |
| # 设置工作目录为 /app | |
| WORKDIR /app | |
| # 将当前目录下的所有文件复制到容器中的工作目录 | |
| COPY . /app | |
| # 创建一个名为 onnx 的新conda环境,指定Python版本为3.10,并激活环境 | |
| RUN conda create -n onnx python=3.10 -y && \ | |
| echo "source activate onnx" >> ~/.bashrc | |
| # 添加清华源,安装requirements.txt中的所有依赖 | |
| ENV PATH /opt/conda/envs/onnx/bin:$PATH | |
| RUN conda install -n onnx pip -y && \ | |
| pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \ | |
| pip install -r requirements.txt | |
| # 容器启动时在onnx环境中执行 server.py | |
| CMD ["conda", "run", "-n", "onnx", "python", "server.py"] | |