amit01Xindus commited on
Commit
c824695
·
verified ·
1 Parent(s): 1451e49

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -14
Dockerfile CHANGED
@@ -1,10 +1,9 @@
1
- # Use a minimal Python base image
2
  FROM python:3.10-slim
3
 
4
- # Install system dependencies including libcrypt and additional libraries for PyMuPDF
5
  RUN apt-get update && \
6
  apt-get install -y \
7
- libcrypt1 \
8
  libgl1-mesa-glx \
9
  libglib2.0-0 \
10
  libsm6 \
@@ -22,32 +21,23 @@ RUN apt-get update && \
22
  libopenjp2-7-dev \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
- # Set working directory
26
  WORKDIR /app
27
 
28
- # Copy requirements first for better caching
29
  COPY requirements.txt .
30
 
31
- # Upgrade pip and install Python dependencies with verbose output
32
  RUN pip install --upgrade pip
33
 
34
- # Install PyMuPDF first to check for issues early
35
  RUN pip install --no-cache-dir PyMuPDF==1.23.0
36
 
37
- # Test PyMuPDF import
38
  RUN python -c "import fitz; print('PyMuPDF imported successfully')"
39
 
40
- # Install remaining dependencies
41
  RUN pip install --no-cache-dir -r requirements.txt
42
 
43
- # Verify python-docx installation
44
  RUN python -c "from docx import Document; print('python-docx installed successfully')"
45
 
46
- # Copy source code to container
47
  COPY . .
48
 
49
- # Expose the port Flask will run on (important for Hugging Face)
50
  EXPOSE 7860
51
 
52
- # Run the Flask app
53
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies including libcrypt, PyMuPDF, and graphics libs
4
  RUN apt-get update && \
5
  apt-get install -y \
6
+ libxcrypt-compat \
7
  libgl1-mesa-glx \
8
  libglib2.0-0 \
9
  libsm6 \
 
21
  libopenjp2-7-dev \
22
  && rm -rf /var/lib/apt/lists/*
23
 
 
24
  WORKDIR /app
25
 
 
26
  COPY requirements.txt .
27
 
 
28
  RUN pip install --upgrade pip
29
 
 
30
  RUN pip install --no-cache-dir PyMuPDF==1.23.0
31
 
32
+ # This will now work
33
  RUN python -c "import fitz; print('PyMuPDF imported successfully')"
34
 
 
35
  RUN pip install --no-cache-dir -r requirements.txt
36
 
 
37
  RUN python -c "from docx import Document; print('python-docx installed successfully')"
38
 
 
39
  COPY . .
40
 
 
41
  EXPOSE 7860
42
 
43
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]