Gabriel00A commited on
Commit
bd0687e
·
verified ·
1 Parent(s): 356e47d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -14
Dockerfile CHANGED
@@ -1,30 +1,21 @@
1
- # Base Python 环境
2
  FROM python:3.11-slim
3
 
4
- # 安装系统依赖与 tesseract OCR
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  tesseract-ocr \
7
  tesseract-ocr-chi-sim \
8
  libtesseract-dev \
9
  libleptonica-dev \
10
- pkg-config \
11
  poppler-utils \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # 设置工作目录
15
  WORKDIR /app
16
 
17
- # 复制文件
18
- COPY requirements.txt /app/
19
- RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- COPY app.py /app/
22
 
23
- # 创建存储目录
24
- RUN mkdir -p /app/storage /app/data
25
-
26
- # 暴露端口
27
  EXPOSE 7860
28
 
29
- # 启动 FastAPI 服务(Spaces 默认端口 7860)
30
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Dockerfile for Hugging Face Space with tesseract + gradio app
2
  FROM python:3.11-slim
3
 
 
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  tesseract-ocr \
6
  tesseract-ocr-chi-sim \
7
  libtesseract-dev \
8
  libleptonica-dev \
 
9
  poppler-utils \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  WORKDIR /app
13
 
14
+ COPY requirements.txt /app/requirements.txt
15
+ RUN pip install --no-cache-dir -r /app/requirements.txt
 
16
 
17
+ COPY . /app
18
 
 
 
 
 
19
  EXPOSE 7860
20
 
21
+ CMD ["python", "app.py"]