Update Dockerfile
Browse files- Dockerfile +37 -22
Dockerfile
CHANGED
|
@@ -2,34 +2,49 @@ FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Asia/Kolkata \
|
| 5 |
-
PYTHONUNBUFFERED=1
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
WORKDIR /web-ui
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# Create venv in /opt (exec mount)
|
| 19 |
-
RUN uv venv /opt/venv --python 3.11
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN
|
|
|
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
pip3 install -r requirements.txt && \
|
| 30 |
-
playwright install --with-deps chromium
|
| 31 |
|
|
|
|
| 32 |
EXPOSE 7860
|
|
|
|
|
|
|
| 33 |
USER root
|
| 34 |
|
|
|
|
| 35 |
CMD ["/opt/venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
ENV DEBIAN_FRONTEND=noninteractive \
|
| 4 |
TZ=Asia/Kolkata \
|
| 5 |
+
PYTHONUNBUFFERED=1 \
|
| 6 |
+
PATH="/opt/venv/bin:$PATH"
|
| 7 |
+
|
| 8 |
+
# Install required OS packages (minimal set, pinned where possible)
|
| 9 |
+
RUN apt-get update && \
|
| 10 |
+
apt-get install -y --no-install-recommends \
|
| 11 |
+
curl \
|
| 12 |
+
ca-certificates \
|
| 13 |
+
git \
|
| 14 |
+
wget \
|
| 15 |
+
procps \
|
| 16 |
+
git-lfs \
|
| 17 |
+
unzip \
|
| 18 |
+
bzip2 \
|
| 19 |
+
libx11-6 \
|
| 20 |
+
build-essential \
|
| 21 |
+
libsndfile-dev \
|
| 22 |
+
python3-pip \
|
| 23 |
+
python3-venv \
|
| 24 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
+
|
| 26 |
+
# Clone repository
|
| 27 |
+
RUN git clone --depth=1 https://github.com/browser-use/web-ui.git /web-ui
|
| 28 |
WORKDIR /web-ui
|
| 29 |
|
| 30 |
+
# Install uv globally (avoids pip bootstrap issues)
|
| 31 |
+
RUN pip3 install --no-cache-dir uv==0.4.17
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
# Create virtual environment in /opt (exec-mounted path)
|
| 34 |
+
RUN uv venv /opt/venv --python 3.11 && \
|
| 35 |
+
chmod -R a+rx /opt/venv && chmod -R a+r /opt/venv
|
| 36 |
|
| 37 |
+
# Install dependencies inside venv
|
| 38 |
+
RUN /opt/venv/bin/python -m ensurepip --upgrade && \
|
| 39 |
+
/opt/venv/bin/pip install --no-cache-dir --upgrade pip uv==0.4.17 playwright && \
|
| 40 |
+
/opt/venv/bin/pip install --no-cache-dir -r requirements.txt && \
|
| 41 |
+
/opt/venv/bin/playwright install --with-deps chromium
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
# Expose application port
|
| 44 |
EXPOSE 7860
|
| 45 |
+
|
| 46 |
+
# Keep root for NVIDIA entrypoint compatibility
|
| 47 |
USER root
|
| 48 |
|
| 49 |
+
# Explicitly use venv Python
|
| 50 |
CMD ["/opt/venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]
|