dina1 commited on
Commit
93ec89a
·
verified ·
1 Parent(s): eaa2117

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -7
Dockerfile CHANGED
@@ -6,25 +6,29 @@ FROM python:3.10-slim
6
 
7
  WORKDIR /app
8
 
9
- # Install system dependencies for Playwright + fonts (no libvpx7)
10
  RUN apt-get update && apt-get install -y \
11
- wget gnupg ca-certificates \
12
  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 libx11-xcb1 libxrender1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Copy dependencies and install them
19
  COPY requirements.txt .
 
 
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # ✅ Install Playwright Chromium with all deps
23
  RUN playwright install --with-deps chromium
24
 
25
- # Copy the app
26
  COPY . .
27
 
 
28
  EXPOSE 7860
29
 
 
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
6
 
7
  WORKDIR /app
8
 
9
+ # Install system dependencies for Playwright + fonts
10
  RUN apt-get update && apt-get install -y \
11
+ wget gnupg ca-certificates curl unzip \
12
  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 \
15
+ fonts-liberation libappindicator3-1 libnspr4 libx11-xcb1 libxrender1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Copy requirements first (for Docker caching)
19
  COPY requirements.txt .
20
+
21
+ # Install Python dependencies
22
  RUN pip install --no-cache-dir -r requirements.txt
23
 
24
+ # ✅ Install Playwright Chromium
25
  RUN playwright install --with-deps chromium
26
 
27
+ # Copy the rest of your application
28
  COPY . .
29
 
30
+ # Expose port 7860 (Hugging Face expects apps to run on this)
31
  EXPOSE 7860
32
 
33
+ # ✅ Use uvicorn to run FastAPI app
34
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]