https://github.com/nerkarso/docker-puppeteer-example
Example to run Puppeteer inside a Docker container
https://github.com/nerkarso/docker-puppeteer-example
docker puppeteer
Last synced: 29 days ago
JSON representation
Example to run Puppeteer inside a Docker container
- Host: GitHub
- URL: https://github.com/nerkarso/docker-puppeteer-example
- Owner: nerkarso
- Created: 2022-07-19T00:43:15.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-06T01:07:11.000Z (over 3 years ago)
- Last Synced: 2025-03-24T15:23:33.411Z (about 1 year ago)
- Topics: docker, puppeteer
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Puppeteer
This is a sample app that runs Puppeteer inside a Docker container.
## Stack
- Docker
- Fastify
- Node.js
## Getting Started
Follow these steps to get the app up and running.
1. Install the Node.js dependencies.
```
npm install
```
2. Make a copy of `.env.example` to `.env.development` and update the credentials.
3. Start the server in development mode.
```sh
npm run dev
```
## Production
Follow these steps to run the app in production.
1. Make a copy of `.env.example` to `.env.production` and update the credentials.
2. Build the Docker image.
```sh
docker build -t docker-puppeteer .
```
3. Run the Docker container.
```sh
docker run -p 3000:3000 --name docker-puppeteer -td docker-puppeteer
```
> You can replace the last `docker-puppeteer` with your container name.
## References
- [Running Puppeteer in Docker](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker)
- [How to Run Puppeteer and Headless Chrome in a Docker Container](https://www.howtogeek.com/devops/how-to-run-puppeteer-and-headless-chrome-in-a-docker-container/)
- [How to use Puppeteer inside a Docker container](https://dev.to/cloudx/how-to-use-puppeteer-inside-a-docker-container-568c)