SeleniumBrowser / Dockerfile
likhonsheikh's picture
Update Dockerfile
31e4e60 verified
FROM ubuntu:22.04
# Set non-interactive frontend
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
python3-pip \
python3-venv \
git \
curl \
wget \
vim \
--no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Playwright and its dependencies
RUN pip3 install --no-cache-dir playwright pytest pytest-playwright
RUN playwright install --with-deps chromium firefox webkit
# Set up a non-root user with sudo privileges
RUN useradd -ms /bin/bash gemini \
&& apt-get update \
&& apt-get install -y sudo \
&& echo "gemini ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/gemini
# Create and set permissions for workspace
RUN mkdir -p /home/gemini/workspace \
&& chown -R gemini:gemini /home/gemini
USER gemini
WORKDIR /home/gemini/workspace
# Set environment variables
ENV PATH="/home/gemini/.local/bin:${PATH}"
ENV PYTHONPATH="/home/gemini/workspace:${PYTHONPATH}"
# Expose ports for the tool API server and debugging
EXPOSE 8001 9229
# Add healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8001/ || exit 1