Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sohelamin/docker-swarm-example
Docker Swarm Example
https://github.com/sohelamin/docker-swarm-example
docker docker-compose docker-swarm dockerstack nodejs
Last synced: 7 days ago
JSON representation
Docker Swarm Example
- Host: GitHub
- URL: https://github.com/sohelamin/docker-swarm-example
- Owner: sohelamin
- Created: 2020-01-04T16:47:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T17:13:15.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T11:08:33.180Z (7 months ago)
- Topics: docker, docker-compose, docker-swarm, dockerstack, nodejs
- Language: JavaScript
- Homepage:
- Size: 763 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Swarm Example
> A sample app for docker swarm## Usage
1. Push to registry or use existing image
```
docker build -t sohelamin/docker-swarm-example .
docker login --username=sohelamin
docker push sohelamin/docker-swarm-example:latest
```2. Install docker in master & worker nodes
```
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt install docker-ce
sudo usermod -aG docker $USER
```3. Configure docker swarm in master node
```
docker swarm init --advertise-addr
```4. Join docker swarm from worker node
```
docker swarm join --token docker swarm join --token :2377
```5. Check the connected node in master node
```
docker node ls
```6. Git clone the github repo then deploy stack
```
git clone https://github.com/sohelamin/docker-swarm-example.git
cd docker-swarm-example
docker stack deploy -c docker-compose.yml docker-swarm-example
```