Spaces:
Running
Running
Commit
·
34d6c3d
1
Parent(s):
e8c034c
Update Dockerfile
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
@@ -7,8 +7,15 @@ WORKDIR /app
|
|
7 |
# 将当前目录下的所有文件复制到容器中的工作目录
|
8 |
COPY . /app
|
9 |
|
10 |
-
#
|
11 |
-
RUN
|
|
|
12 |
|
13 |
-
#
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# 将当前目录下的所有文件复制到容器中的工作目录
|
8 |
COPY . /app
|
9 |
|
10 |
+
# 创建一个名为 onnx 的新conda环境,指定Python版本为3.10,并激活环境
|
11 |
+
RUN conda create -n onnx python=3.10 -y && \
|
12 |
+
echo "source activate onnx" >> ~/.bashrc
|
13 |
|
14 |
+
# 添加清华源,安装requirements.txt中的所有依赖
|
15 |
+
ENV PATH /opt/conda/envs/onnx/bin:$PATH
|
16 |
+
RUN conda install -n onnx pip -y && \
|
17 |
+
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
|
18 |
+
pip install -r requirements.txt
|
19 |
+
|
20 |
+
# 容器启动时在onnx环境中执行 server.py
|
21 |
+
CMD ["conda", "run", "-n", "onnx", "python", "server.py"]
|