Spaces:
Runtime error
Runtime error
| # 使用 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"] | |