neuroama commited on
Commit
2cdb326
·
1 Parent(s): 04bd6ae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -13
Dockerfile CHANGED
@@ -1,20 +1,29 @@
1
- # 使用 Hugging Face 的 PyTorch 容器作为基础镜像
2
- FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime
3
 
4
- # 安装 Git
5
- RUN apt-get update && apt-get install -y git
6
 
7
- # 设置工作目录
8
- WORKDIR /workspace
9
 
10
- # 克隆 Gradio 示例项目
11
- RUN git clone https://huggingface.co/spaces/neuroama/so-vits-svc
12
 
13
- # 安装 Gradio 示例项目依赖
14
- WORKDIR /workspace/so-vits-svc
15
- RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # 设置容器启动时运行的命令
18
- CMD ["python", "app.py"]
19
 
 
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ FROM docker.io/library/python:3.10@sha256:ba7e6f1feea05621dec8a6525e1bb9edf30a3897bc6fd047d72f860ff0b73706
 
3
 
4
+ RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
 
5
 
6
+ WORKDIR /home/user/app
 
7
 
8
+ RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
 
 
9
 
10
+ RUN useradd -m -u 1000 user
 
11
 
12
+ RUN --mount=target=/root/packages.txt,source=packages.txt apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
 
14
+ RUN --mount=target=pre-requirements.txt,source=pre-requirements.txt pip install --no-cache-dir -r pre-requirements.txt
15
+
16
+ RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
17
+
18
+ RUN pip install --no-cache-dir gradio[oauth]==3.46.1 "uvicorn>=0.14.0" spaces==0.19.4
19
+
20
+ COPY --link --chown=1000 --from=lfs /app /home/user/app
21
+
22
+ COPY --link --chown=1000 ./ /home/user/app
23
+
24
+ RUN pip freeze > /tmp/freeze.txt
25
+
26
+ COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt .
27
+ Pushing image
28
+
29
+ Exporting cache