1 | initial version |
Install Docker on your MacOS Apple Silicon M1 arm64 machine.
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
# 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" ]
docker build -t my-puppeteer-app .
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
.