dina1 commited on
Commit
418feb4
·
verified ·
1 Parent(s): 0d4dc99

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -12
Dockerfile CHANGED
@@ -1,15 +1,12 @@
1
  # ===============================
2
- # 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Gemini + Playwright
3
  # ===============================
4
 
5
- # 1️⃣ Use a lightweight Python base image
6
  FROM python:3.10-slim
7
 
8
- # 2️⃣ Set working directory
9
  WORKDIR /app
10
 
11
- # 3️⃣ Install system dependencies for Playwright (Chromium)
12
- # These are required to run Chromium headless in the container.
13
  RUN apt-get update && apt-get install -y \
14
  chromium \
15
  libasound2 \
@@ -30,22 +27,19 @@ RUN apt-get update && apt-get install -y \
30
  xdg-utils \
31
  fonts-liberation \
32
  fonts-unifont \
33
- fonts-ubuntu \
34
  && rm -rf /var/lib/apt/lists/*
35
 
36
- # 4️⃣ Copy and install Python dependencies
37
  COPY requirements.txt .
38
  RUN pip install --no-cache-dir -r requirements.txt
39
 
40
- # 5️⃣ Install Playwright browsers (Chromium only)
41
- # Using --with-deps=false since dependencies are already installed
42
  RUN playwright install chromium --with-deps=false
43
 
44
- # 6️⃣ Copy all project files
45
  COPY . .
46
 
47
- # 7️⃣ Expose the default Hugging Face port
48
  EXPOSE 7860
49
 
50
- # 8️⃣ Start FastAPI using Uvicorn
51
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # ===============================
2
+ # 🐳 Dockerfile for Hugging Face Spaces - FastAPI + Gemini + Playwright (Fixed Fonts)
3
  # ===============================
4
 
 
5
  FROM python:3.10-slim
6
 
 
7
  WORKDIR /app
8
 
9
+ # Install system dependencies for Playwright (Chromium)
 
10
  RUN apt-get update && apt-get install -y \
11
  chromium \
12
  libasound2 \
 
27
  xdg-utils \
28
  fonts-liberation \
29
  fonts-unifont \
30
+ fonts-ubuntu-font-family-console \
31
  && rm -rf /var/lib/apt/lists/*
32
 
33
+ # Copy dependencies
34
  COPY requirements.txt .
35
  RUN pip install --no-cache-dir -r requirements.txt
36
 
37
+ # Install Playwright Chromium (dependencies already installed)
 
38
  RUN playwright install chromium --with-deps=false
39
 
40
+ # Copy all project files
41
  COPY . .
42
 
 
43
  EXPOSE 7860
44
 
 
45
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]