What is Docker Compose | How to create docker compose file | How to use Compose

25 Comments



Free Tutorials – https://automationstepbystep.com/
I am Raghav & Today we will learn :
1. What | Why – Docker Compose
2. How to install
3. How to create docker compose file
4. How to use docker compose file to create services
5. Basic Commands

TIPS
Docker compose
: tool for defining & running multi-container docker applications
: use yaml files to configure application services (docker-compose.yml)
: can start all services with a single command : docker compose up
: can stop all services with a single command : docker compose down
: can scale up selected services when required

Step 1 : install docker compose
(already installed on windows and mac with docker)
docker-compose -v

2 Ways

1. https://github.com/docker/compose/releases

2. Using PIP
pip install -U docker-compose

Step 2 : Create docker compose file at any location on your system
docker-compose.yml

Step 3 : Check the validity of file by command
docker-compose config

Step 4 : Run docker-compose.yml file by command
docker-compose up -d

Steps 5 : Bring down application by command
docker-compose down

TIPS
How to scale services

—scale
docker-compose up -d –scale database=4

References:
https://hub.docker.com

https://github.com/docker/compose/releases

https://docs.docker.com/compose/compose-file/

https://www.google.co.in/search?q=microservices+example&rlz=1C5CHFA_enIN734IN734&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjE3LPQqYfcAhXGpY8KHQHmB4gQ_AUICigB#imgrc=4466IjbSng_wcM:
_____________________________________________________________

#DockerCompose #DockerComposeIntroduction #DockerContainers #DockerTutorials #DockerTraining #DevOpsTools #DevOpsTraining #DockerCommands #DockerForBeginners #DockerFreeTutorials #DockerforDevOps

DOCKER PLAYLIST

YOUTUBE PLAYLIST
https://www.youtube.com/channel/UCTt7pyY-o0eltq14glaG5dg/playlists

YOUTUBE
https://www.youtube.com/automationstepbystep

FACEBOOK
https://www.facebook.com/automationstepbystep

TWITTER
https://twitter.com/automationsbs

If you like videos on the channel Automation Step by Step, hit the like button and share with others.

Click the SUBSCRIBE button and hit the bell icon to keep getting new videos.

Ask Raghav- https://bit.ly/2CoJGWf
Interviews – https://bit.ly/2NIPPxk
All Playlists – https://bit.ly/2LSiezA

———— Follow ————
Facebook – https://www.facebook.com/automationstepbystep
Twitter – https://twitter.com/automationsbs
Youtube – http://youtube.com/automationstepbystep

source

25 Comments
    • blank
      Chamindu Yasitha
      May 09, 2022 11:51 am Reply

      That was very helpful

    • blank
      Mohdsiddique Bagwan
      May 09, 2022 11:51 am Reply

      Really good video. Just one piece of feedback, you can keep the docker-compose.yml file open, don't need to close it many times

    • blank
      Vignesh Palanisamy
      May 09, 2022 11:51 am Reply

      Hi, in yml we are saying service and all other values like web , database. But can you please tell me why i need to use service and why i can not use other name instead of service. Where these values are defined? How docker knows this value? Thank for your help

    • blank
      Kalaivani Ravishankar
      May 09, 2022 11:51 am Reply

      such a wonderful explanation. Thank you so much for short and crisp explanation. Iam a beginner, your videos helped me a lot .

    • blank
      Suresh Thota
      May 09, 2022 11:51 am Reply

      I used this command docker-compose up -d –scale web=4 and i got this error WARNING: Host is already in use by another container. How to over come this error raghav gaaru.

    • blank
      Youssef Nour
      May 09, 2022 11:51 am Reply

      thank you very much, bro, all hope for you to be the best programmer ever …..

    • blank
      pujan raj rai
      May 09, 2022 11:51 am Reply

      great tutorial

    • blank
      sravan venus
      May 09, 2022 11:51 am Reply

      Just awesome explanation sir

    • blank
      OLA Uber
      May 09, 2022 11:51 am Reply

      hwo to get rid of error "Top-level object must be a mapping
      "

    • blank
      Jaya Kumar
      May 09, 2022 11:51 am Reply

      If I didn't like this video, That will be the first mistake of mine for today.. Very well explained 👌

    • blank
      nazia arfeen
      May 09, 2022 11:51 am Reply

      Hey, You're awesome.. just love the way you teach! 🙂

    • blank
      Thomas Mohanraj
      May 09, 2022 11:51 am Reply

      You are excellent !!!!

    • blank
      András Németh
      May 09, 2022 11:51 am Reply

      What browser do you use? That start page looks awesome!
      And thanks for the great educational content btw 🙂

    • blank
      salar khan
      May 09, 2022 11:51 am Reply

      Thanks bro it really helped!!!!. 👍🏻

    • blank
      Prince Kumar
      May 09, 2022 11:51 am Reply

      Thank You! 🙂

    • blank
      Pwnograffik
      May 09, 2022 11:51 am Reply

      very informative, thank you

    • blank
      sandeep reddy
      May 09, 2022 11:51 am Reply

      Great Explanation Raghav..!

    • blank
      Jorge Blandon
      May 09, 2022 11:51 am Reply

      Thank for sharing.!

    • blank
      ShanthKumar S
      May 09, 2022 11:51 am Reply

      Thank You, Raghav for your explanation.

    • blank
      Sophiya Anudeep
      May 09, 2022 11:51 am Reply

      Thank you sir. Your teaching skill is marvelous… God bless you.

    • blank
      FxStreamer
      May 09, 2022 11:51 am Reply

      video starts at 7:18

    • blank
      Fabian Leon
      May 09, 2022 11:51 am Reply

      Really helpfull, thank you!

    • blank
      Pavon Dunbar
      May 09, 2022 11:51 am Reply

      Great video…even 3 years later. Thank you. Subscribed.

    • blank
      Ravindu Samaranayake
      May 09, 2022 11:51 am Reply

      Thank you!

Leave us a comment