coium commited on
Commit
b579322
·
verified ·
1 Parent(s): 23f04f9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -10
Dockerfile CHANGED
@@ -1,18 +1,15 @@
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
-
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
 
10
  WORKDIR /app
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
16
 
17
  # 暴露端口
18
  EXPOSE 8080
@@ -21,5 +18,5 @@ EXPOSE 8080
21
  HEALTHCHECK --interval=30s --timeout=5s \
22
  CMD curl -f http://localhost:8080/v1/models || exit 1
23
 
24
- # 启动命令
25
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
 
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
+ FROM python:3.9-slim
 
 
 
 
5
 
6
+ # 设置工作目录
7
  WORKDIR /app
8
 
9
+ # 复制应用代码
10
+ COPY . .
11
 
12
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
  # 暴露端口
15
  EXPOSE 8080
 
18
  HEALTHCHECK --interval=30s --timeout=5s \
19
  CMD curl -f http://localhost:8080/v1/models || exit 1
20
 
21
+ # 运行应用
22
+ CMD ["python", "app.py"]