Update Dockerfile
Browse files- Dockerfile +19 -11
Dockerfile
CHANGED
|
@@ -2,11 +2,8 @@ FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Asia/Kolkata \
|
| 5 |
-
PYTHONUNBUFFERED=1
|
| 6 |
-
PATH="/opt/venv/bin:$PATH"
|
| 7 |
|
| 8 |
-
# Create and use a non-root user
|
| 9 |
-
RUN useradd -ms /bin/bash admin
|
| 10 |
|
| 11 |
# Install required OS packages (minimal set, pinned where possible)
|
| 12 |
RUN apt-get update && \
|
|
@@ -22,13 +19,28 @@ RUN apt-get update && \
|
|
| 22 |
libx11-6 \
|
| 23 |
build-essential \
|
| 24 |
libsndfile-dev \
|
| 25 |
-
python3-pip \
|
| 26 |
-
python3-venv \
|
| 27 |
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
# Clone repository
|
| 30 |
RUN git clone https://github.com/browser-use/web-ui.git /web-ui
|
| 31 |
WORKDIR /web-ui
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Install uv globally (avoids pip bootstrap issues)
|
| 34 |
RUN pip3 install --no-cache-dir uv==0.4.17
|
|
@@ -36,7 +48,7 @@ RUN pip3 install --no-cache-dir uv==0.4.17
|
|
| 36 |
# Create virtual environment in /opt (exec-mounted path)
|
| 37 |
RUN uv venv --python 3.11 && \
|
| 38 |
chmod -R a+rx /web-ui/.venv && chmod -R a+r /web-ui/.venv
|
| 39 |
-
|
| 40 |
# Install dependencies inside venv
|
| 41 |
RUN .venv/bin/python3 -m ensurepip && \
|
| 42 |
.venv/bin/pip3 install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \
|
|
@@ -49,9 +61,5 @@ EXPOSE 7860
|
|
| 49 |
# Set ownership and permissions for the app directory
|
| 50 |
RUN chown -R admin:admin /web-ui && chmod -R 777 /web-ui
|
| 51 |
|
| 52 |
-
|
| 53 |
-
# Switch to the non-root user for better security
|
| 54 |
-
USER admin
|
| 55 |
-
|
| 56 |
# Explicitly use venv Python
|
| 57 |
CMD [".venv/bin/python3", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Asia/Kolkata \
|
| 5 |
+
PYTHONUNBUFFERED=1
|
|
|
|
| 6 |
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Install required OS packages (minimal set, pinned where possible)
|
| 9 |
RUN apt-get update && \
|
|
|
|
| 19 |
libx11-6 \
|
| 20 |
build-essential \
|
| 21 |
libsndfile-dev \
|
|
|
|
|
|
|
| 22 |
&& rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
+
# Set up the Conda environment
|
| 25 |
+
ENV CONDA_AUTO_UPDATE_CONDA=false \
|
| 26 |
+
PATH=$HOME/miniconda/bin:$PATH
|
| 27 |
+
|
| 28 |
+
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
|
| 29 |
+
&& chmod +x ~/miniconda.sh \
|
| 30 |
+
&& ~/miniconda.sh -b -p ~/miniconda \
|
| 31 |
+
&& rm ~/miniconda.sh \
|
| 32 |
+
&& conda clean -ya
|
| 33 |
+
|
| 34 |
# Clone repository
|
| 35 |
RUN git clone https://github.com/browser-use/web-ui.git /web-ui
|
| 36 |
WORKDIR /web-ui
|
| 37 |
+
|
| 38 |
+
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 39 |
+
&& chown -R user:user /web-ui
|
| 40 |
+
|
| 41 |
+
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
| 42 |
+
|
| 43 |
+
USER user
|
| 44 |
|
| 45 |
# Install uv globally (avoids pip bootstrap issues)
|
| 46 |
RUN pip3 install --no-cache-dir uv==0.4.17
|
|
|
|
| 48 |
# Create virtual environment in /opt (exec-mounted path)
|
| 49 |
RUN uv venv --python 3.11 && \
|
| 50 |
chmod -R a+rx /web-ui/.venv && chmod -R a+r /web-ui/.venv
|
| 51 |
+
|
| 52 |
# Install dependencies inside venv
|
| 53 |
RUN .venv/bin/python3 -m ensurepip && \
|
| 54 |
.venv/bin/pip3 install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \
|
|
|
|
| 61 |
# Set ownership and permissions for the app directory
|
| 62 |
RUN chown -R admin:admin /web-ui && chmod -R 777 /web-ui
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# Explicitly use venv Python
|
| 65 |
CMD [".venv/bin/python3", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
|