FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 ENV DEBIAN_FRONTEND=noninteractive \ TZ=Asia/Kolkata \ PYTHONUNBUFFERED=1 \ PATH="/opt/venv/bin:$PATH" # 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 \ python3-pip \ python3-venv \ && rm -rf /var/lib/apt/lists/* # Clone repository RUN git clone --depth=1 https://github.com/browser-use/web-ui.git /web-ui WORKDIR /web-ui # 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 /opt/venv --python 3.11 && \ chmod -R a+rx /opt/venv && chmod -R a+r /opt/venv # Install dependencies inside venv RUN /opt/venv/bin/python -m ensurepip --upgrade && \ /opt/venv/bin/pip install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \ /opt/venv/bin/pip install --no-cache-dir -r requirements.txt && \ /opt/venv/bin/playwright install --with-deps chromium # Expose application port EXPOSE 7860 # Keep root for NVIDIA entrypoint compatibility USER root # Explicitly use venv Python CMD ["/opt/venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]