leonarb commited on
Commit
73c1ffe
·
verified ·
1 Parent(s): 04da152

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -11
Dockerfile CHANGED
@@ -1,36 +1,40 @@
1
- # Base image with Python 3.11 and CUDA (for GPU support; remove/change if CPU-only)
2
  FROM python:3.11-slim
3
 
4
- # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive \
6
  PYTHONUNBUFFERED=1 \
7
  PIP_NO_CACHE_DIR=1
8
 
9
- # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
11
  git \
 
 
12
  ffmpeg \
13
  libsm6 \
14
  libxext6 \
15
  libgl1-mesa-glx \
16
- build-essential \
 
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # Install git-lfs and initialize (if needed by olmocr)
20
  RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
21
  apt-get install -y git-lfs && git lfs install
22
 
23
- # Set working directory
24
  WORKDIR /app
25
 
26
- # Copy requirement files
27
  COPY requirements.txt .
28
-
29
- # Install Python dependencies
30
  RUN pip install --upgrade pip && pip install -r requirements.txt
31
 
32
- # Copy application code
33
  COPY . .
34
 
35
- # Run Gradio app
 
 
 
36
  CMD ["python", "app.py"]
 
1
+ # Use Python 3.11 slim base image
2
  FROM python:3.11-slim
3
 
4
+ # Avoid interactive prompts
5
  ENV DEBIAN_FRONTEND=noninteractive \
6
  PYTHONUNBUFFERED=1 \
7
  PIP_NO_CACHE_DIR=1
8
 
9
+ # Install system packages
10
  RUN apt-get update && apt-get install -y \
11
  git \
12
+ curl \
13
+ build-essential \
14
  ffmpeg \
15
  libsm6 \
16
  libxext6 \
17
  libgl1-mesa-glx \
18
+ poppler-utils \
19
+ tesseract-ocr \
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
+ # Install git-lfs (olmocr uses some models hosted on LFS)
23
  RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
24
  apt-get install -y git-lfs && git lfs install
25
 
26
+ # Set workdir
27
  WORKDIR /app
28
 
29
+ # Copy requirements and install Python packages
30
  COPY requirements.txt .
 
 
31
  RUN pip install --upgrade pip && pip install -r requirements.txt
32
 
33
+ # Copy rest of the application
34
  COPY . .
35
 
36
+ # Expose port (Gradio runs on 7860 by default, but HF Spaces handles routing)
37
+ EXPOSE 7860
38
+
39
+ # Run the Gradio app
40
  CMD ["python", "app.py"]