DevOps Classroomnotes 26/Nov/2022

Docker Swarm Contd..

  • We have initialize the swarm cluster and created two services
    • nginx docker service create --replicas 2 --publish mode=host,target=80,published=8080 nginx
    • jenkins docker service create --replicas 2 --publish mode=host,target=8080,published=8081 jenkins/jenkins
  • To access them we have used 8080 port of any node in cluster
  • To access jenkins we have used 8081 port of any node in cluster

Docker-Compose

  • Docker compose lets run multiple containers in a Docker and also lets define the necessary volumes and networks
  • Hello-world docker compose. Create a file called as docker-compose.yaml
services:
  app:
    image: httpd
    ports:
      - "8080:80"
  db:
    image: mysql
  • now execute docker-compose up -d

Exercise:

  • Try running the flask application and database in a same bridge network Refer Here
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency
Exit mobile version
%%footer%%