web-ui / Dockerfile
binary1ne's picture
Update Dockerfile
0dec3e1 verified
raw
history blame
1.92 kB
FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive \
TZ=Asia/Kolkata \
PYTHONUNBUFFERED=1
# Install some basic utilities
RUN rm -f /etc/apt/sources.list.d/*.list && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
sudo \
git \
wget \
procps \
git-lfs \
zip \
unzip \
htop \
vim \
nano \
bzip2 \
libx11-6 \
build-essential \
libsndfile-dev \
python3-pip\
python3-venv\
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
# Clone the web-ui repository from GitHub.
RUN git clone https://github.com/browser-use/web-ui.git
RUN ls -la
# Set the working directory to the newly cloned repository.
WORKDIR /web-ui
RUN ls -la /web-ui
# Install uv first, then use it to create the virtual environment and install dependencies.
RUN pip install uv
# Create a virtual environment using uv.
RUN uv venv --python 3.11
# Set the PATH to include the virtual environment's binary directory.
# ENV PATH="/app/web-ui/.venv/bin:$PATH"
RUN ls -la
#RUN source .venv/bin/activate
RUN ls -la .venv/bin/
# Install Python dependencies and the Chromium browser with Playwright within the venv.
RUN .venv/bin/python -m ensurepip --upgrade
#RUN source .venv/bin/activate
RUN ls -la .venv/bin/
RUN .venv/bin/pip3 install uv playwright
#RUN source .venv/bin/activate
RUN ls -la .venv/bin/
# RUN .venv/bin/uv pip3 install -r requirements.txt \
RUN .venv/bin/pip3 install -r /web-ui/requirements.txt \
&& .venv/bin/playwright install --with-deps chromium
RUN chmod -R 777 /web-ui/*
# Expose the default port for the web application.
EXPOSE 7860
# Command to run the application when the container starts.
# We bind to 0.0.0.0 to make the web UI accessible from outside the container.
CMD [".venv/bin/python", "webui.py", "--ip", "0.0.0.0", "--port", "7860"]