https://github.com/maximization/scaling-nodejs-with-docker
Sample Node.js project showing how to scale horizontally with Docker
https://github.com/maximization/scaling-nodejs-with-docker
cluster-mode docker pm2 scale
Last synced: 4 days ago
JSON representation
Sample Node.js project showing how to scale horizontally with Docker
- Host: GitHub
- URL: https://github.com/maximization/scaling-nodejs-with-docker
- Owner: Maximization
- License: mit
- Created: 2020-04-24T08:39:56.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-09-10T19:08:32.000Z (9 months ago)
- Last Synced: 2025-09-10T22:51:02.048Z (9 months ago)
- Topics: cluster-mode, docker, pm2, scale
- Language: JavaScript
- Homepage: https://maximorlov.com/from-pm2-to-docker-cluster-mode/
- Size: 10.7 KB
- Stars: 50
- Watchers: 2
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scaling Node.js with Docker
This project shows how to scale a Node.js application with Docker Compose and use multiple CPU cores. It's similar to cluster mode in PM2, but with a few fundemantal differences. Read more in the accompanying article — [From PM2 to Docker: Cluster Mode](https://maximorlov.com/from-pm2-to-docker-cluster-mode/).
## Getting started
1. Clone this repository `git clone https://github.com/Maximization/scaling-nodejs-with-docker.git && cd scaling-nodejs-with-docker`
2. Start the application stack scaled to four app instances `docker-compose up -d --scale app=4`
3. Visit `http://localhost` in your browser
4. Hit refresh and you will see sequential responses from each application instance