binary1ne commited on
Commit
78be0d3
·
verified ·
1 Parent(s): 7809a2d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -58
Dockerfile CHANGED
@@ -4,75 +4,39 @@ ENV DEBIAN_FRONTEND=noninteractive \
4
  TZ=Asia/Kolkata \
5
  PYTHONUNBUFFERED=1
6
 
7
- # Install some basic utilities
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
- curl \
11
- ca-certificates \
12
- sudo \
13
- git \
14
- wget \
15
- procps \
16
- git-lfs \
17
- zip \
18
- unzip \
19
- htop \
20
- vim \
21
- nano \
22
- bzip2 \
23
- libx11-6 \
24
- build-essential \
25
- libsndfile-dev \
26
- python3-pip\
27
- python3-venv\
28
- software-properties-common \
29
- && rm -rf /var/lib/apt/lists/*
30
 
31
- # Clone the web-ui repository from GitHub.
32
- RUN git clone https://github.com/browser-use/web-ui.git
33
-
34
- RUN ls -la
35
-
36
- # Set the working directory to the newly cloned repository.
37
  WORKDIR /web-ui
38
 
39
- RUN ls -la /web-ui
40
-
41
- # Install uv first, then use it to create the virtual environment and install dependencies.
42
  RUN pip install uv
43
 
44
- # Create a virtual environment using uv.
45
  RUN uv venv --python 3.11
46
 
47
- # Set the PATH to include the virtual environment's binary directory.
48
- # ENV PATH="/app/web-ui/.venv/bin:$PATH"
49
- RUN ls -la
50
-
51
- #RUN source .venv/bin/activate
52
- RUN ls -la .venv/bin/
53
-
54
- # Install Python dependencies and the Chromium browser with Playwright within the venv.
55
- RUN .venv/bin/python -m ensurepip --upgrade
56
-
57
- #RUN source .venv/bin/activate
58
- RUN ls -la .venv/bin/
59
-
60
- RUN .venv/bin/pip3 install uv playwright
61
 
62
- #RUN source .venv/bin/activate
63
- RUN ls -la .venv/bin/
 
 
 
64
 
65
- # RUN .venv/bin/uv pip3 install -r requirements.txt \
66
- RUN .venv/bin/pip3 install -r /web-ui/requirements.txt \
67
- && .venv/bin/playwright install --with-deps chromium
68
 
69
- RUN chmod -R 777 /web-ui/*
70
- RUN chmod +x /web-ui/.venv/bin/python
71
 
72
- # (Optional) run as root to avoid permission issues
73
  USER root
74
- # Expose the default port for the web application.
75
- EXPOSE 7860
76
- # Command to run the application when the container starts.
77
- # We bind to 0.0.0.0 to make the web UI accessible from outside the container.
78
- CMD [".venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
 
4
  TZ=Asia/Kolkata \
5
  PYTHONUNBUFFERED=1
6
 
7
+ # Install base dependencies
8
  RUN rm -f /etc/apt/sources.list.d/*.list && \
9
  apt-get update && apt-get install -y --no-install-recommends \
10
+ curl ca-certificates sudo git wget procps git-lfs \
11
+ zip unzip htop vim nano bzip2 libx11-6 build-essential \
12
+ libsndfile-dev python3-pip python3-venv software-properties-common \
13
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ # Clone the web-ui repository
16
+ RUN git clone https://github.com/browser-use/web-ui.git /web-ui
 
 
 
 
17
  WORKDIR /web-ui
18
 
19
+ # Install uv
 
 
20
  RUN pip install uv
21
 
22
+ # Create venv
23
  RUN uv venv --python 3.11
24
 
25
+ # Ensure python is executable
26
+ RUN chmod +x /web-ui/.venv/bin/python
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
+ # Install dependencies and chromium
29
+ RUN /web-ui/.venv/bin/python -m ensurepip --upgrade && \
30
+ /web-ui/.venv/bin/pip install --upgrade pip uv playwright && \
31
+ /web-ui/.venv/bin/pip install -r requirements.txt && \
32
+ /web-ui/.venv/bin/playwright install --with-deps chromium
33
 
34
+ # Fix permissions (recursive + follow symlinks)
35
+ RUN chmod -R a+rx /web-ui/.venv && chmod -R a+r /web-ui
 
36
 
37
+ EXPOSE 7860
 
38
 
39
+ # Keep root to avoid runtime permission drops
40
  USER root
41
+
42
+ CMD ["/web-ui/.venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]