Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Install Docker on your MacOS Apple Silicon M1 arm64 machine.

  2. Pull a Docker image that supports Puppeteer and is compatible with the arm64 architecture. You can use the official Node.js Docker image with arm64 support:

docker pull node:16-alpine3.14
  1. Create a Dockerfile for your Puppeteer project. Here is an example:
# Start with the official Node.js Docker image with arm64 support
FROM node:16-alpine3.14

# Set the working directory to /app
WORKDIR /app

# Copy the package.json and package-lock.json files to /app
COPY package*.json ./

# Install the dependencies
RUN npm install

# Copy the rest of the files to /app
COPY . .

# Expose port 3000 for the Puppeteer server
EXPOSE 3000

# Set the command to start the Puppeteer server
CMD [ "npm", "start" ]
  1. Build the Docker image from the Dockerfile:
docker build -t my-puppeteer-app .
  1. Run the Docker container:
docker run -p 3000:3000 my-puppeteer-app

This will start the Puppeteer server inside the Docker container and map port 3000 to port 3000 on your MacOS Apple Silicon M1 arm64 machine. You can access the Puppeteer server by opening a web browser and navigating to http://localhost:3000.