d3evil4 commited on
Commit
aee3f8a
·
verified ·
1 Parent(s): 6ac3546

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python image as base
2
+ FROM python:3.11-slim
3
+
4
+ # Install OS dependencies for Playwright and Chromium
5
+ RUN apt-get update && apt-get install -y \
6
+ wget gnupg curl unzip \
7
+ libnss3 libatk-bridge2.0-0 libgtk-3-0 \
8
+ libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 \
9
+ libxi6 libxtst6 libxrandr2 libcups2 libasound2 \
10
+ libpangocairo-1.0-0 libpango-1.0-0 libgbm1 \
11
+ libxshmfence1 libatspi2.0-0 \
12
+ && apt-get clean \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Set work directory
16
+ WORKDIR /app
17
+
18
+ # Copy project files
19
+ COPY . .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --upgrade pip
23
+ RUN pip install fastapi uvicorn playwright nest_asyncio
24
+
25
+ # Install Playwright browsers (Chromium only)
26
+ RUN playwright install --with-deps chromium
27
+
28
+ # Expose the FastAPI port
29
+ EXPOSE 8000
30
+
31
+ # Command to run the FastAPI app
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]