FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV CI=true
RUN apt-get update -qq && \
apt-get install -y \
curl \
ca-certificates \
gnupg \
sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list && \
apt-get update -qq && \
apt-get install -y google-chrome-stable && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs
RUN npm install -g pnpm
RUN useradd -m -s /bin/bash testuser && \
echo 'testuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN apt-get update -qq && \
apt-get remove -y xvfb || true && \
apt-get autoremove -y && \
rm -f /usr/bin/xvfb-run /usr/local/bin/xvfb-run && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN ! which xvfb-run || exit 1
WORKDIR /app
USER testuser
CMD ["bash"]