- Clone the repository
git clone https://github.com/m3rryqold/headless-chrome-nodejs-docker.git &&
cd headless-chrome-nodejs-docker
- Build the image
docker build -t headless-chrome .
if you encounter platform related issues, e.g running it on a MacOS, you can use the following command
docker build --platform linux/amd64 -t headless-chrome .
- Run the image
docker run -p 3000:3000 headless-chrome
localhost:3000/screenshot