dina1 commited on
Commit
38612e0
·
verified ·
1 Parent(s): 7811cef

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -3
Dockerfile CHANGED
@@ -2,21 +2,31 @@
2
  # 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Gemini + Playwright
3
  # ===============================
4
 
5
- # Use a lightweight Python base image
6
  FROM python:3.10-slim
7
 
8
  # Set working directory
9
  WORKDIR /app
10
 
 
 
 
 
 
 
 
 
11
  # Copy and install Python dependencies
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
 
 
 
15
  # Copy all project files
16
  COPY . .
17
 
18
  # Expose the default Hugging Face port
19
  EXPOSE 7860
20
 
21
- # Start FastAPI using Uvicorn
22
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
  # 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Gemini + Playwright
3
  # ===============================
4
 
 
5
  FROM python:3.10-slim
6
 
7
  # Set working directory
8
  WORKDIR /app
9
 
10
+ # Install system dependencies required by Playwright and fonts for PDF rendering
11
+ RUN apt-get update && apt-get install -y \
12
+ wget gnupg ca-certificates libxkbcommon0 libnss3 libatk1.0-0 libatk-bridge2.0-0 \
13
+ libxcomposite1 libxdamage1 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 \
14
+ libasound2 libxshmfence1 libxext6 libxfixes3 libdrm2 fonts-liberation \
15
+ libappindicator3-1 libnspr4 libvpx7 libx11-xcb1 libxrender1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
  # Copy and install Python dependencies
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # ✅ Install Playwright + Chromium dependencies
23
+ RUN playwright install --with-deps chromium
24
+
25
  # Copy all project files
26
  COPY . .
27
 
28
  # Expose the default Hugging Face port
29
  EXPOSE 7860
30
 
31
+ # Default command
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]