Arihant0008 commited on
Commit
f32b034
·
verified ·
1 Parent(s): 51f0ee2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -4,17 +4,17 @@ FROM python:3.9-slim
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # CRITICAL FIX: Install all system dependencies for OpenCV AND WeasyPrint in one go.
8
- # This version adds the final 'libpangoft2' library to fix the crash.
9
  RUN apt-get update && \
10
  apt-get install -y --no-install-recommends \
11
  libgl1 \
 
12
  libpango-1.0-0 \
 
13
  libcairo2 \
14
  libgdk-pixbuf-xlib-2.0-0 \
15
- fontconfig \
16
  libffi-dev \
17
- libpangoft2-1.0-0 \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  # Copy and install Python dependencies first to leverage Docker layer caching
@@ -30,6 +30,7 @@ RUN mkdir -p static/uploads && chmod 777 static/uploads
30
  # Hugging Face Spaces expose port 7860 by default
31
  EXPOSE 7860
32
 
33
- # Command to run the application using Gunicorn on the correct port
34
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
35
 
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Install all system dependencies for OpenCV AND WeasyPrint in one go.
 
8
  RUN apt-get update && \
9
  apt-get install -y --no-install-recommends \
10
  libgl1 \
11
+ libgthread-2.0-0 \
12
  libpango-1.0-0 \
13
+ libpangoft2-1.0-0 \
14
  libcairo2 \
15
  libgdk-pixbuf-xlib-2.0-0 \
 
16
  libffi-dev \
17
+ fontconfig \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  # Copy and install Python dependencies first to leverage Docker layer caching
 
30
  # Hugging Face Spaces expose port 7860 by default
31
  EXPOSE 7860
32
 
33
+ # --- FINAL FIX: ADDED --timeout 120 ---
34
+ # Command to run the application using Gunicorn with an increased timeout
35
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"]
36