Spaces:
Sleeping
Sleeping
fix bugs
Browse files- Dockerfile +31 -12
- sidekick_tools.py +1 -1
Dockerfile
CHANGED
|
@@ -1,21 +1,40 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
|
| 5 |
-
WORKDIR /usr/src/app
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY . .
|
| 13 |
|
| 14 |
-
# Expose the port your application will listen on
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
-
|
| 18 |
-
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 19 |
-
|
| 20 |
-
# Define the command to run your application
|
| 21 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
|
|
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
# Install system dependencies for Playwright
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
wget \
|
| 8 |
+
gnupg \
|
| 9 |
+
ca-certificates \
|
| 10 |
+
fonts-liberation \
|
| 11 |
+
libappindicator3-1 \
|
| 12 |
+
libasound2 \
|
| 13 |
+
libatk-bridge2.0-0 \
|
| 14 |
+
libatk1.0-0 \
|
| 15 |
+
libcups2 \
|
| 16 |
+
libdbus-1-3 \
|
| 17 |
+
libgdk-pixbuf2.0-0 \
|
| 18 |
+
libnspr4 \
|
| 19 |
+
libnss3 \
|
| 20 |
+
libx11-xcb1 \
|
| 21 |
+
libxcomposite1 \
|
| 22 |
+
libxdamage1 \
|
| 23 |
+
libxrandr2 \
|
| 24 |
+
xdg-utils \
|
| 25 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 26 |
+
|
| 27 |
+
# Copy requirements and install Python packages
|
| 28 |
COPY requirements.txt .
|
| 29 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
+
# Install Playwright browsers
|
| 32 |
+
RUN playwright install chromium
|
| 33 |
+
RUN playwright install-deps chromium
|
| 34 |
+
|
| 35 |
+
# Copy application files
|
| 36 |
COPY . .
|
| 37 |
|
|
|
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
sidekick_tools.py
CHANGED
|
@@ -20,7 +20,7 @@ serper = GoogleSerperAPIWrapper()
|
|
| 20 |
|
| 21 |
async def playwright_tools():
|
| 22 |
playwright = await async_playwright().start()
|
| 23 |
-
browser = await playwright.chromium.launch(headless=
|
| 24 |
toolkit = PlayWrightBrowserToolkit.from_browser(async_browser=browser)
|
| 25 |
return toolkit.get_tools(), browser, playwright
|
| 26 |
|
|
|
|
| 20 |
|
| 21 |
async def playwright_tools():
|
| 22 |
playwright = await async_playwright().start()
|
| 23 |
+
browser = await playwright.chromium.launch(headless=True)
|
| 24 |
toolkit = PlayWrightBrowserToolkit.from_browser(async_browser=browser)
|
| 25 |
return toolkit.get_tools(), browser, playwright
|
| 26 |
|