From 6a7204b93c91ae38015628dbad8483947422cb5c Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 22 Oct 2023 22:14:17 +0100 Subject: [PATCH] Fix Dockerfile (currently broken as there is no `jovyan` group) --- .github/workflows/build.yaml | 42 ++++++++++++++++++++++++++++++++++++ Dockerfile | 11 +++++----- 2 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..399676f4 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,42 @@ +# This is a GitHub workflow defining a set of jobs with a set of steps. +# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions +# +name: Build + +on: + pull_request: + paths-ignore: + - "docs/**" + - ".github/workflows/*.yaml" + - "!.github/workflows/build.yaml" + push: + paths-ignore: + - "docs/**" + - ".github/workflows/*.yaml" + - "!.github/workflows/build.yaml" + branches-ignore: + - "dependabot/**" + - "pre-commit-ci-update-config" + tags: ["**"] + workflow_dispatch: + +jobs: + container: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + + - name: Build image + run: | + docker build -t jupyter-remote-desktop-proxy . + + - name: Smoke test image + run: | + docker run -d -p 8888:8888 jupyter-remote-desktop-proxy + sleep 10 + curl 'http://localhost:8888/desktop/?token=secret' | grep 'Modified from novnc_lite.html example in noVNC' + + # TODO: Check VNC desktop works, e.g. by comparing Playwright screenshots + # https://playwright.dev/docs/test-snapshots diff --git a/Dockerfile b/Dockerfile index 4966b0ac..e6cd6f75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,10 +20,9 @@ RUN apt-get -y -q update \ USER $NB_USER -RUN mamba install --yes websockify +COPY --chown=$NB_UID:$NB_GID jupyter_remote_desktop_proxy /opt/install/jupyter_remote_desktop_proxy +COPY --chown=$NB_UID:$NB_GID environment.yml setup.py MANIFEST.in README.md LICENSE /opt/install/ -COPY --chown=$NB_USER:$NB_USER jupyter_remote_desktop_proxy /opt/install/jupyter_remote_desktop_proxy -COPY --chown=$NB_USER:$NB_USER setup.py MANIFEST.in README.md LICENSE /opt/install/ - -RUN cd /opt/install \ - && pip install -e . +RUN cd /opt/install && \ + . /opt/conda/bin/activate && \ + mamba env update --quiet --file environment.yml