Spaces:
Sleeping
Sleeping
Commit ·
6e19aaa
1
Parent(s): 89f42fb
Add Dockerfile and update for HuggingFace Space deployment
Browse files- .gitignore +5 -1
- Dockerfile +53 -0
- models.json +0 -0
- requirements.txt +2 -2
- src/main.py +0 -0
.gitignore
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
venv/
|
| 2 |
*webui_secret_key
|
| 3 |
*cache_ggshield
|
| 4 |
-
config.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
venv/
|
| 2 |
*webui_secret_key
|
| 3 |
*cache_ggshield
|
| 4 |
+
config.json
|
| 5 |
+
chrome_profile/
|
| 6 |
+
__pycache__/
|
| 7 |
+
*.pyc
|
| 8 |
+
.env
|
Dockerfile
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
|
| 3 |
+
# Install Chrome and dependencies for nodriver
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
wget \
|
| 6 |
+
gnupg2 \
|
| 7 |
+
apt-transport-https \
|
| 8 |
+
ca-certificates \
|
| 9 |
+
fonts-liberation \
|
| 10 |
+
libasound2 \
|
| 11 |
+
libatk-bridge2.0-0 \
|
| 12 |
+
libatk1.0-0 \
|
| 13 |
+
libatspi2.0-0 \
|
| 14 |
+
libcups2 \
|
| 15 |
+
libdbus-1-3 \
|
| 16 |
+
libdrm2 \
|
| 17 |
+
libgbm1 \
|
| 18 |
+
libgtk-3-0 \
|
| 19 |
+
libnspr4 \
|
| 20 |
+
libnss3 \
|
| 21 |
+
libxcomposite1 \
|
| 22 |
+
libxdamage1 \
|
| 23 |
+
libxfixes3 \
|
| 24 |
+
libxkbcommon0 \
|
| 25 |
+
libxrandr2 \
|
| 26 |
+
xdg-utils \
|
| 27 |
+
libu2f-udev \
|
| 28 |
+
libvulkan1 \
|
| 29 |
+
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg \
|
| 30 |
+
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
|
| 31 |
+
&& apt-get update \
|
| 32 |
+
&& apt-get install -y google-chrome-stable \
|
| 33 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 34 |
+
|
| 35 |
+
# Set working directory
|
| 36 |
+
WORKDIR /app
|
| 37 |
+
|
| 38 |
+
# Copy requirements and install Python dependencies
|
| 39 |
+
COPY requirements.txt .
|
| 40 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 41 |
+
|
| 42 |
+
# Copy application code
|
| 43 |
+
COPY . .
|
| 44 |
+
|
| 45 |
+
# Expose port 7860 (HuggingFace Spaces default)
|
| 46 |
+
EXPOSE 7860
|
| 47 |
+
|
| 48 |
+
# Set environment variables
|
| 49 |
+
ENV PYTHONUNBUFFERED=1
|
| 50 |
+
ENV PORT=7860
|
| 51 |
+
|
| 52 |
+
# Run the application
|
| 53 |
+
CMD ["python", "src/main.py"]
|
models.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
-
|
| 4 |
-
playwright
|
| 5 |
httpx
|
|
|
|
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
+
nodriver
|
|
|
|
| 4 |
httpx
|
| 5 |
+
curl_cffi>=0.6.0
|
src/main.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|