binary1ne commited on
Commit
1727112
·
verified ·
1 Parent(s): 849760f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -22
Dockerfile CHANGED
@@ -2,34 +2,49 @@ FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Asia/Kolkata \
5
- PYTHONUNBUFFERED=1
6
-
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- curl ca-certificates sudo git wget procps git-lfs \
9
- zip unzip htop vim nano bzip2 libx11-6 build-essential \
10
- libsndfile-dev python3-pip python3-venv software-properties-common \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- RUN git clone https://github.com/browser-use/web-ui.git /web-ui
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  WORKDIR /web-ui
15
 
16
- RUN pip3 install uv
17
-
18
- # Create venv in /opt (exec mount)
19
- RUN uv venv /opt/venv --python 3.11
20
 
21
- # Ensure world execute/read
22
- RUN chmod -R a+rx /opt/venv && chmod -R a+r /opt/venv
 
23
 
24
- RUN source /opt/venv/bin/activate.sh
25
-
26
- # Install deps in /opt/venv
27
- RUN python3 -m ensurepip --upgrade && \
28
- pip3 install --upgrade pip uv playwright && \
29
- pip3 install -r requirements.txt && \
30
- playwright install --with-deps chromium
31
 
 
32
  EXPOSE 7860
 
 
33
  USER root
34
 
 
35
  CMD ["/opt/venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Asia/Kolkata \
5
+ PYTHONUNBUFFERED=1 \
6
+ PATH="/opt/venv/bin:$PATH"
7
+
8
+ # Install required OS packages (minimal set, pinned where possible)
9
+ RUN apt-get update && \
10
+ apt-get install -y --no-install-recommends \
11
+ curl \
12
+ ca-certificates \
13
+ git \
14
+ wget \
15
+ procps \
16
+ git-lfs \
17
+ unzip \
18
+ bzip2 \
19
+ libx11-6 \
20
+ build-essential \
21
+ libsndfile-dev \
22
+ python3-pip \
23
+ python3-venv \
24
+ && rm -rf /var/lib/apt/lists/*
25
+
26
+ # Clone repository
27
+ RUN git clone --depth=1 https://github.com/browser-use/web-ui.git /web-ui
28
  WORKDIR /web-ui
29
 
30
+ # Install uv globally (avoids pip bootstrap issues)
31
+ RUN pip3 install --no-cache-dir uv==0.4.17
 
 
32
 
33
+ # Create virtual environment in /opt (exec-mounted path)
34
+ RUN uv venv /opt/venv --python 3.11 && \
35
+ chmod -R a+rx /opt/venv && chmod -R a+r /opt/venv
36
 
37
+ # Install dependencies inside venv
38
+ RUN /opt/venv/bin/python -m ensurepip --upgrade && \
39
+ /opt/venv/bin/pip install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \
40
+ /opt/venv/bin/pip install --no-cache-dir -r requirements.txt && \
41
+ /opt/venv/bin/playwright install --with-deps chromium
 
 
42
 
43
+ # Expose application port
44
  EXPOSE 7860
45
+
46
+ # Keep root for NVIDIA entrypoint compatibility
47
  USER root
48
 
49
+ # Explicitly use venv Python
50
  CMD ["/opt/venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]