isididiidid commited on
Commit
3a9e1b3
·
verified ·
1 Parent(s): 3c24080

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -16
Dockerfile CHANGED
@@ -1,27 +1,21 @@
1
- FROM python:3.12.9-slim-bullseye
2
 
3
  WORKDIR /app
4
 
5
- ENV PYTHONDONTWRITEBYTECODE=1 \
6
- PYTHONUNBUFFERED=1 \
7
- LANG=C.UTF-8 \
8
- LC_ALL=C.UTF-8
9
-
10
- RUN apt-get update \
11
- && apt-get install -y --no-install-recommends \
12
- curl \
13
- build-essential \
14
- nodejs \
15
- npm \
16
- && rm -rf /var/lib/apt/lists/*
17
-
18
- COPY . .
19
 
 
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
22
  EXPOSE 7860
23
 
24
- CMD ["python", "app.py"]
 
 
25
 
26
 
27
 
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
+ # 复制项目文件
6
+ COPY app.py /app/
7
+ COPY requirements.txt /app/
8
+ COPY .env /app/
 
 
 
 
 
 
 
 
 
 
9
 
10
+ # 安装依赖
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # 暴露Hugging Face Space默认使用的端口
14
  EXPOSE 7860
15
 
16
+ # 启动应用(使用7860端口)
17
+ CMD ["bash", "-c", "PORT=7860 python app.py"]
18
+
19
 
20
 
21