binary1ne commited on
Commit
b9f704d
·
verified ·
1 Parent(s): f345b2d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -2
Dockerfile CHANGED
@@ -28,17 +28,28 @@ RUN rm -f /etc/apt/sources.list.d/*.list && \
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
-
42
  # Install uv first, then use it to create the virtual environment and install dependencies.
43
  RUN pip install uv
44
 
@@ -67,6 +78,7 @@ RUN ls -la .venv/bin/
67
  RUN .venv/bin/pip3 install -r /web-ui/requirements.txt \
68
  && .venv/bin/playwright install --with-deps chromium
69
 
 
70
  RUN chmod -R 777 /web-ui/*
71
  # Expose the default port for the web application.
72
  EXPOSE 7860
 
28
  software-properties-common \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
+
32
+ # Create a non-root user and switch to it
33
+ RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
34
+ && chown -R user:user /app
35
+ RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
36
+ USER user
37
+
38
+ # All users can use /home/user as their home directory
39
+ ENV HOME=/home/user
40
+ RUN mkdir $HOME/.cache $HOME/.config \
41
+ && chmod -R 777 $HOME
42
+
43
  # Clone the web-ui repository from GitHub.
44
  RUN git clone https://github.com/browser-use/web-ui.git
45
 
46
  RUN ls -la
47
 
48
  # Set the working directory to the newly cloned repository.
49
+ WORKDIR $HOME/web-ui
50
 
51
  RUN ls -la /web-ui
52
 
 
53
  # Install uv first, then use it to create the virtual environment and install dependencies.
54
  RUN pip install uv
55
 
 
78
  RUN .venv/bin/pip3 install -r /web-ui/requirements.txt \
79
  && .venv/bin/playwright install --with-deps chromium
80
 
81
+ RUN chown user:user /data
82
  RUN chmod -R 777 /web-ui/*
83
  # Expose the default port for the web application.
84
  EXPOSE 7860