Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
# 使用Python官方镜像
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
#
|
5 |
ENV HF_HOME=/model-cache \
|
6 |
PYTHONUNBUFFERED=1 \
|
7 |
-
PORT=7860
|
8 |
|
9 |
# 安装系统依赖
|
10 |
RUN apt-get update && \
|
@@ -31,8 +31,8 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
31 |
# 复制应用代码
|
32 |
COPY app.py .
|
33 |
|
34 |
-
#
|
35 |
EXPOSE 7860
|
36 |
|
37 |
-
#
|
38 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "app:app"]
|
|
|
1 |
# 使用Python官方镜像
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# 设置环境变量(正确语法)
|
5 |
ENV HF_HOME=/model-cache \
|
6 |
PYTHONUNBUFFERED=1 \
|
7 |
+
PORT=7860
|
8 |
|
9 |
# 安装系统依赖
|
10 |
RUN apt-get update && \
|
|
|
31 |
# 复制应用代码
|
32 |
COPY app.py .
|
33 |
|
34 |
+
# 暴露端口
|
35 |
EXPOSE 7860
|
36 |
|
37 |
+
# 启动命令
|
38 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "600", "app:app"]
|