dina1 commited on
Commit
3aefc8e
·
verified ·
1 Parent(s): dc079f4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -3
Dockerfile CHANGED
@@ -4,9 +4,12 @@
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,18 +30,28 @@ RUN apt-get update && apt-get install -y \
27
  xdg-utils \
28
  fonts-liberation \
29
  fonts-unifont \
 
30
  && rm -rf /var/lib/apt/lists/*
31
 
32
- # Copy dependencies
 
 
33
  COPY requirements.txt .
34
  RUN pip install --no-cache-dir -r requirements.txt
35
 
 
36
  # Install Playwright Chromium (dependencies already installed)
37
- RUN playwright install chromium --with-deps=false
 
 
38
 
 
39
  # Copy all project files
 
40
  COPY . .
41
 
 
42
  EXPOSE 7860
43
 
 
44
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
4
 
5
  FROM python:3.10-slim
6
 
7
+ # Set working directory
8
  WORKDIR /app
9
 
10
+ # -------------------------------
11
+ # Install system dependencies for Playwright + fonts
12
+ # -------------------------------
13
  RUN apt-get update && apt-get install -y \
14
  chromium \
15
  libasound2 \
 
30
  xdg-utils \
31
  fonts-liberation \
32
  fonts-unifont \
33
+ fonts-ubuntu \
34
  && rm -rf /var/lib/apt/lists/*
35
 
36
+ # -------------------------------
37
+ # Copy dependencies first (cache friendly)
38
+ # -------------------------------
39
  COPY requirements.txt .
40
  RUN pip install --no-cache-dir -r requirements.txt
41
 
42
+ # -------------------------------
43
  # Install Playwright Chromium (dependencies already installed)
44
+ # -------------------------------
45
+ RUN pip install --no-cache-dir playwright \
46
+ && playwright install chromium --with-deps=false
47
 
48
+ # -------------------------------
49
  # Copy all project files
50
+ # -------------------------------
51
  COPY . .
52
 
53
+ # Expose the port
54
  EXPOSE 7860
55
 
56
+ # Start FastAPI
57
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]