clove1002 commited on
Commit
0e73ca4
·
verified ·
1 Parent(s): 76e1db4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -11
Dockerfile CHANGED
@@ -1,25 +1,42 @@
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
6
- RUN apt-get update && \
7
- apt-get install -y wget gnupg curl ca-certificates fonts-liberation libnss3 libatk-bridge2.0-0 \
8
- libgtk-3-0 libxss1 libasound2 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils \
9
- libgbm1 && \
10
- apt-get clean && \
11
- rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
- # Copy files and install Python deps
14
  COPY requirements.txt .
15
- RUN pip install --upgrade pip && pip install -r requirements.txt
16
 
17
- # Install Playwright and Chromium
18
  RUN playwright install --with-deps
19
 
20
- # Copy your FastAPI app files
21
- COPY . .
22
 
 
23
  EXPOSE 7860
24
 
 
25
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Create a working directory
4
  WORKDIR /app
5
 
6
  # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ curl \
9
+ wget \
10
+ gnupg \
11
+ unzip \
12
+ fonts-liberation \
13
+ libnss3 \
14
+ libatk1.0-0 \
15
+ libatk-bridge2.0-0 \
16
+ libcups2 \
17
+ libxcomposite1 \
18
+ libxdamage1 \
19
+ libxrandr2 \
20
+ libgbm1 \
21
+ libasound2 \
22
+ libpangocairo-1.0-0 \
23
+ libxshmfence1 \
24
+ libxss1 \
25
+ libgtk-3-0 \
26
+ && rm -rf /var/lib/apt/lists/*
27
 
28
+ # Install Python dependencies
29
  COPY requirements.txt .
30
+ RUN pip install --no-cache-dir -r requirements.txt
31
 
32
+ # Install Playwright browsers
33
  RUN playwright install --with-deps
34
 
35
+ # Copy app code
36
+ COPY app/ app/
37
 
38
+ # Expose port
39
  EXPOSE 7860
40
 
41
+ # Start server
42
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]