Professional Documents
Culture Documents
#!/bin/bash
sudo apt-get update
sudo apt-get install curl -y
sudo curl -fsSL get.docksal.io | bash
sudo usermod -aG docker ubuntu
======================================================================
# Initialize docker swarm cluster by exeuting below command on docker server which
you want make it as Manager
docker swarm join-token worker (Get the token in manager & exeute in nodes)
======================================================================
docker run imageName --> It will create/deploy one application in single machine
--> docker service create
# List Services
docker service ls
# List Services process
docker service ps <servicenName>
# Scale Services
docker service scale javawebapp=3
# Stack Deploy
version: '3.1'
services:
springboot:
image: dockerhandson/spring-boot-mongo:latest
restart: always
container_name: springboot
ports:
- 8182:8080
working_dir: /opt/app
depends_on:
- mongo
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
mongo:
image: mongo
container_name: mongo
# ports: # for demo/debug purpose only
# - 27018:27017
volumes:
- data:/data/db
- data-bkp:/data/bkp
restart: always
volumes:
data:
data-bkp:
=================================================================
docker stack deploy --compose-file docker-compose.yml springmongo
docker stack ls
version: '3.1'
services:
springboot:
image: dockerhandson/spring-boot-mongo:latest
restart: always
container_name: springboot
ports:
- 8182:8080
working_dir: /opt/app
depends_on:
- mongo
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
mongo:
image: mongo
container_name: mongo
# ports: # for demo/debug purpose only
# - 27018:27017
volumes:
- data:/data/db
- data-bkp:/data/bkp
restart: always
volumes:
data:
external: true
data-bkp:
external: true
networks:
default:
external:
name: customoverlay