FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 ENV DEBIAN_FRONTEND=noninteractive \ TZ=Asia/Kolkata \ PYTHONUNBUFFERED=1 # 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 \ && rm -rf /var/lib/apt/lists/* # Set up the Conda environment ENV CONDA_AUTO_UPDATE_CONDA=false \ PATH=$HOME/miniconda/bin:$PATH RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \ && chmod +x ~/miniconda.sh \ && ~/miniconda.sh -b -p ~/miniconda \ && rm ~/miniconda.sh \ && conda clean -ya # Clone repository RUN git clone https://github.com/browser-use/web-ui.git /web-ui WORKDIR /web-ui RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ && chown -R user:user /web-ui RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user USER user # 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/python3 -m ensurepip && \ .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 # Explicitly use venv Python CMD [".venv/bin/python3", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]