Docker image with Node.js and Chromium for tests (with headless handling) and preinstalled Cypress (7.3.0) in App directory for faster CI/CD.
Latest version: 0.3
docker build -t lennetech/node-chromium:latest .
Dockerfile
:
# Use docker image
FROM lennetech/node-chromium
# Go to work directory
WORKDIR /usr/src/app
# Install
COPY ["path/to/app/root-dir/package*.json", "./"]
RUN npm ci
# Test and build app
COPY ["path/to/app/root-dir/", "./"]
RUN npm run test:headless
RUN npm run build
docker-compose.yml
:
version: "3.7"
services:
frontend:
build: .
Install docker: https://docs.docker.com/get-started/#download-and-install-docker-desktop
docker login --username=lennetech --password=PASSWORD
docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 --push -t lennetech/node-chromium:latest .
(see How to build x86 (and others!) Docker images on an M1 Mac)