Skip to content

Commit

Permalink
feat: add docker containers with VNC access
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Apr 14, 2024
1 parent 25c3229 commit f20a5f2
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,17 @@ services:
volumes:
- ./tests/cypress:/opt/test/cypress
- ./entrypoint.sh:/opt/test/entrypoint.sh
# For local testing with access via VNC
materials-designer-test-vnc:
image: materials-designer-test:${IMAGE_TAG}
build:
args:
BASE_TAG: ${IMAGE_TAG}
context: .
dockerfile: ./dockerfiles/app/test/Dockerfile-vnc
# - materials-designer
ports:
- 5920:5920
volumes:
- ./tests/cypress:/opt/test/cypress
- ./entrypoint.sh:/opt/test/entrypoint.sh
40 changes: 40 additions & 0 deletions dockerfiles/app/test/Dockerfile-vnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# From https://hub.docker.com/r/cypress/browsers/tags
FROM cypress/included:13.6.0

WORKDIR /opt/test

COPY ./tests/package.json package.json
COPY ./tests/package-lock.json package-lock.json
COPY ./tests/cypress.config.ts cypress.config.ts
COPY ./tests/cypress cypress

RUN npm install


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

RUN Xvfb :20 -screen 0 1920x1080x16 && \
sleep 1 && \
x11vnc -display :20 -N -forever -bg -o "/tmp/x11vnc.log" && \
sleep 1 && \
DISPLAY=:20 fluxbox -log /tmp/fluxbox.log &

ENTRYPOINT ["tail", "-f", "/dev/null" ]

0 comments on commit f20a5f2

Please sign in to comment.