arif670 commited on
Commit
bb0d2c0
·
verified ·
1 Parent(s): 39eb0b8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -17
Dockerfile CHANGED
@@ -1,35 +1,25 @@
1
- # Use a Debian-based Python image for reliable package installation
2
  FROM python:3.9-buster
3
 
4
- # Prevent Python from writing pyc files and enable unbuffered output
5
  ENV PYTHONDONTWRITEBYTECODE=1
6
  ENV PYTHONUNBUFFERED=1
7
 
8
- # Update package lists and install system dependencies:
9
- # - graphviz (provides the dot executable)
10
- # - wkhtmltopdf (for PDF generation)
11
  RUN apt-get update && apt-get install -y \
12
- graphviz \
13
- wkhtmltopdf \
14
- && ln -sf /usr/bin/dot /usr/local/bin/dot \
15
- && ln -sf /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf \
 
 
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Add /usr/local/bin to PATH and set GRAPHVIZ_DOT explicitly
19
- ENV PATH="/usr/local/bin:${PATH}"
20
- ENV GRAPHVIZ_DOT="/usr/local/bin/dot"
21
-
22
  WORKDIR /app
23
 
24
- # Copy and install Python dependencies
25
  COPY requirements.txt /app/requirements.txt
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
- # Copy application code
29
  COPY . /app
30
 
31
- # Expose Gradio's default port
32
  EXPOSE 7860
33
 
34
- # Run the application
35
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.9-buster
2
 
 
3
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
 
6
+ # Install system packages: poppler-utils is needed for pdf2image; weasyprint has few extra dependencies too.
 
 
7
  RUN apt-get update && apt-get install -y \
8
+ poppler-utils \
9
+ libpango-1.0-0 \
10
+ libpangocairo-1.0-0 \
11
+ libgdk-pixbuf2.0-0 \
12
+ libffi-dev \
13
+ libcairo2 \
14
  && rm -rf /var/lib/apt/lists/*
15
 
 
 
 
 
16
  WORKDIR /app
17
 
 
18
  COPY requirements.txt /app/requirements.txt
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
 
21
  COPY . /app
22
 
 
23
  EXPOSE 7860
24
 
 
25
  CMD ["python", "app.py"]