Update Dockerfile
Browse files- Dockerfile +7 -6
Dockerfile
CHANGED
|
@@ -4,17 +4,17 @@ FROM python:3.9-slim
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 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 |
-
|
| 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 |
-
#
|
| 34 |
-
|
|
|
|
| 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 |
|