# Prepare a testbed for Javascript testing # This image should be tagged as "isso-js-testbed" # Note: Do not use alpine images as they do not contain needed GObject, X11 # etc. packages and complicate things # :22-bookworm resolves to NodeJS 22 on Debian Bookworm as of 04/2024 # https://hub.docker.com/_/node FROM docker.io/node:22-bookworm AS isso-js-testbed WORKDIR /src/ # Install everything necessary to run headless RUN apt-get update && apt-get install -y --no-install-recommends libnss3 libxss1 chromium # Install the test toolchain from the lockfile, so that the weekly image # rebuild keeps resolving the versions declared in package.json. Resolving # these fresh from the registry mixes jest majors: jest-environment-puppeteer # depends on jest-environment-node ^29, which does not work under jest 30. # # This pulls in puppeteer with its ~400Mb headless chrome file, so it takes a # while. COPY package.json package-lock.json ./ RUN npm ci # Need to set $CI so that jest-puppeteer applies sensible launch params for # running headless chromium. Otherwise, chromium will fail with a "missing # sandbox" error. # https://github.com/smooth-code/jest-puppeteer/blob/678ce56b49100f248237757df19f89b2542a9465/packages/jest-environment-puppeteer/src/readConfig.js#L14-L28 ENV CI=true # Note: No entry point, will be set by docker-compose # Example of use: # # docker build -f docker/Dockerfile-js-testbed -t isso-js-testbed . # vim: set filetype=dockerfile