File size: 1,513 Bytes
d7d2934
8a43ca9
d7d2934
 
1727112
 
 
69210ea
 
 
1727112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69210ea
049f904
3da3e4c
1727112
 
2971656
1727112
69210ea
 
855aee4
1727112
bab5c99
 
69210ea
3da3e4c
1727112
78be0d3
1727112
69210ea
 
 
 
 
 
78be0d3
1727112
69210ea
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
FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=Asia/Kolkata \
    PYTHONUNBUFFERED=1 \
    PATH="/opt/venv/bin:$PATH"

# Create and use a non-root user
RUN useradd -ms /bin/bash admin

# Install required OS packages (minimal set, pinned where possible)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    git \
    wget \
    procps \
    git-lfs \
    unzip \
    bzip2 \
    libx11-6 \
    build-essential \
    libsndfile-dev \
    python3-pip \
    python3-venv \
    && rm -rf /var/lib/apt/lists/*

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

# Install uv globally (avoids pip bootstrap issues)
RUN pip3 install --no-cache-dir uv==0.4.17

# Create virtual environment in /opt (exec-mounted path)
RUN uv venv --python 3.11 && \
    chmod -R a+rx /web-ui/.venv && chmod -R a+r /web-ui/.venv

# Install dependencies inside venv
RUN .venv/bin/pip3 install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \
    .venv/bin/pip3 install --no-cache-dir -r requirements.txt && \
    .venv/bin/playwright install --with-deps chromium

# Expose application port
EXPOSE 7860

# Set ownership and permissions for the app directory
RUN chown -R admin:admin /web-ui && chmod -R 777 /web-ui


# Switch to the non-root user for better security
USER admin

# Explicitly use venv Python
CMD [".venv/bin/python3", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]