File size: 1,980 Bytes
3da3e4c
 
8a43ca9
3da3e4c
 
8a43ca9
9b94fcd
 
3da3e4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a43ca9
3da3e4c
 
8a43ca9
3da3e4c
 
 
2971656
 
 
 
 
 
 
3ffeff1
 
2971656
8855fbe
2a31ba2
2971656
 
3999bb0
 
cca7e86
 
 
855aee4
 
 
 
 
fa2cdc1
 
bb078d6
3da3e4c
 
9a08443
8a43ca9
3da3e4c
 
9a08443
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Use Python 3.11 as the base image.
FROM python:3.11-slim

# Set the working directory inside the container.
WORKDIR /app

# Install system dependencies required for Git and a minimal set for Playwright.
# This list is based on the most common runtime dependencies for headless browsers.
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    git \
    libnss3 \
    libdbus-1-3 \
    libatk1.0-0 \
    libatk-bridge2.0-0 \
    libdrm2 \
    libxcomposite1 \
    libxext6 \
    libxfixes3 \
    libxrandr2 \
    libgbm1 \
    libexpat1 \
    libfontconfig1 \
    libharfbuzz0b \
    libfreetype6 \
    libpng16-16 \
    libjpeg62-turbo \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Clone the web-ui repository from GitHub.
RUN git clone https://github.com/browser-use/web-ui.git

# Set the working directory to the newly cloned repository.
WORKDIR /app/web-ui

# Install uv first, then use it to create the virtual environment and install dependencies.
RUN pip install uv

# Create a virtual environment using uv.
RUN uv venv --python 3.11

# Set the PATH to include the virtual environment's binary directory.
# ENV PATH="/app/web-ui/.venv/bin:$PATH"
RUN ls -la 

#RUN source .venv/bin/activate
RUN ls -la .venv/bin/

# Install Python dependencies and the Chromium browser with Playwright within the venv.
RUN .venv/bin/python -m ensurepip --upgrade

#RUN source .venv/bin/activate
RUN ls -la .venv/bin/

RUN .venv/bin/pip3 install uv playwright 

#RUN source .venv/bin/activate
RUN ls -la .venv/bin/

# RUN .venv/bin/uv pip3 install -r requirements.txt \
RUN .venv/bin/pip3 install -r requirements.txt \
    && .venv/bin/playwright install --with-deps chromium

# Expose the default port for the web application.
EXPOSE 7860

# Command to run the application when the container starts.
# We bind to 0.0.0.0 to make the web UI accessible from outside the container.
CMD [".venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]