File size: 1,854 Bytes
d7d2934
8a43ca9
d7d2934
 
 
8a43ca9
d7d2934
 
 
 
 
 
3da3e4c
d7d2934
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=Asia/Kolkata \
    PYTHONUNBUFFERED=1 

# Install some basic utilities
RUN rm -f /etc/apt/sources.list.d/*.list && \
    apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    sudo \
    git \
    wget \
    procps \
    git-lfs \
    zip \
    unzip \
    htop \
    vim \
    nano \
    bzip2 \
    libx11-6 \
    build-essential \
    libsndfile-dev \
    python3-pip\
    python3-venv\
    software-properties-common \
 && 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"]