- Install nvm
- Using nvm install node 17.4.0
- Install Docker
- Install Docker Compose 2.0
- Create Docker registry
$ docker service create --name registry --publish published=5000,target=5000 registry:2
- Build the application's container
$ docker compose build
- Publish application container image
$ docker compose push
- Initialize Docker Swarm
$ docker swarm init --advertise-addr <your-ip-goes-here>
- Deploy the stack to Docker Swarm
$ docker stack deploy --compose-file docker-compose.yml demo
- Scale the application
$ docker service scale demo_web=16