# From https://hub.docker.com/r/cypress/browsers/tags
FROM materials-designer-test:latest

# Followed instructions from https://spin.atomicobject.com/cypress-running-docker-container/
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
  curl \
  libgtk2.0-0 \
  libgtk-3-0 \
  libgbm-dev \
  libnotify-dev \
  libgconf-2-4 \
  libnss3 \
  libxss1 \
  libasound2 \
  libxtst6 \
  xauth \
  xvfb \
  x11vnc \
  fluxbox

# Install Chrome
RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /tmp/google-chrome.deb
RUN apt-get install -y /tmp/google-chrome.deb

ENV CYPRESS_BASE_URL=${CYPRESS_BASE_URL:-'http://host.docker.internal:3001'}

ENTRYPOINT ["/opt/test/entrypoint-vnc.sh"]
