binary1ne commited on
Commit
3da3e4c
·
verified ·
1 Parent(s): 8a43ca9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +58 -25
Dockerfile CHANGED
@@ -1,31 +1,64 @@
1
- # Use the official smanx/browser-use-web-ui image as the base.
2
- # It is a best practice to pin to a specific version tag for reproducibility,
3
- # but 'latest' is used here for convenience.
4
- FROM smanx/browser-use-web-ui:latest
5
 
6
- # Set maintainer information (optional but good practice).
7
- LABEL maintainer="Your Name <your.email@example.com>"
8
 
9
- # Set default environment variables for LLM APIs.
10
- # You MUST replace the placeholder values with your actual API keys
11
- # when you run the container.
12
- ENV OPENAI_API_KEY="" \
13
- ANTHROPIC_API_KEY="" \
14
- GOOGLE_API_KEY=""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- # Set default browser configuration variables.
17
- ENV BROWSER_DEBUGGING_PORT="9222" \
18
- BROWSER_DEBUGGING_HOST="localhost" \
19
- BROWSER_USE_LOGGING_LEVEL="info" \
20
- ANONYMIZED_TELEMETRY="false" \
21
- KEEP_BROWSER_OPEN="false"
22
 
23
- # Expose the ports that the application uses for the Web UI, VNC (web and direct),
24
- # and the browser debugging interface.
 
 
 
 
 
 
 
25
  EXPOSE 7788
26
- EXPOSE 6080
27
- EXPOSE 5901
28
- EXPOSE 9222
29
 
30
- # The base image already has a command to run the application, so we don't
31
- # need to specify CMD here unless we want to override the default behavior.
 
 
1
+ # Use Python 3.11 as the base image.
2
+ FROM python:3.11-slim
 
 
3
 
4
+ # Set the working directory inside the container.
5
+ WORKDIR /app
6
 
7
+ # Install system dependencies required for Git and Playwright.
8
+ # We install a minimal set of libraries to keep the image small.
9
+ RUN apt-get update \
10
+ && apt-get install -y --no-install-recommends \
11
+ git \
12
+ libnss3 \
13
+ libnspr4 \
14
+ libdbus-1-3 \
15
+ libatk1.0-0 \
16
+ libatk-bridge2.0-0 \
17
+ libcups2 \
18
+ libdrm2 \
19
+ libgdk-pixbuf2.0-0 \
20
+ libglib2.0-0 \
21
+ libgssapi-krb5-2 \
22
+ libxcomposite1 \
23
+ libxcursor1 \
24
+ libxdamage1 \
25
+ libxext6 \
26
+ libxfixes3 \
27
+ libxi6 \
28
+ libxrandr2 \
29
+ libxrender1 \
30
+ libxkbcommon0 \
31
+ libx11-xcb1 \
32
+ libxshmfence1 \
33
+ libgbm1 \
34
+ libwayland-client0 \
35
+ libwayland-egl1 \
36
+ libwayland-cursor0 \
37
+ libexpat1 \
38
+ libfontconfig1 \
39
+ libharfbuzz0b \
40
+ libfreetype6 \
41
+ libpng16-16 \
42
+ libjpeg62-turbo \
43
+ libwebp6 \
44
+ libglib2.0-0 \
45
+ && apt-get clean \
46
+ && rm -rf /var/lib/apt/lists/*
47
 
48
+ # Clone the web-ui repository from GitHub.
49
+ RUN git clone https://github.com/browser-use/web-ui.git
 
 
 
 
50
 
51
+ # Set the working directory to the newly cloned repository.
52
+ WORKDIR /app/web-ui
53
+
54
+ # Install Python dependencies using uv and install the Chromium browser with Playwright.
55
+ RUN pip install uv \
56
+ && uv pip install -r requirements.txt \
57
+ && playwright install --with-deps chromium
58
+
59
+ # Expose the default port for the web application.
60
  EXPOSE 7788
 
 
 
61
 
62
+ # Command to run the application when the container starts.
63
+ # We bind to 0.0.0.0 to make the web UI accessible from outside the container.
64
+ CMD ["python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]