Docker-compose tutorial

If you have watched my video about "docker explained simply", we will now have a look at how to easily manage multiple Docker containers with just one simple configuration file. We will deploy a simple web server and database.
Docker-compose documentation: docs.docker.com/compose/
Install docker-compose: docs.docker.com/compose/install/
Follow me:
TWITTER: / christianlempa
INSTAGRAM: / christianlempa
DISCORD: / discord
GITHUB: github.com/christianlempa
PATREON: / christianlempa
MY EQUIPMENT: kit.co/christianlempa
Timestamps:
00:00 - Introduction
01:29 Get started with docker-compose.yaml
03:29 Versioning in docker-compose files
04:40 Deploy a simple webserver with docker-compose
11:30 Add more containers like database
17:00 Remove all docker containers from docker-compose file
18:03 Summary
----
All links with "*" are affiliate links.

Пікірлер: 102

  • @mathewkargarzadeh3158
    @mathewkargarzadeh31583 жыл бұрын

    Simple and Understandable docker-compose explanation. Excellent illustration !!. Thanks and gratitude to you !!

  • @starryblue4
    @starryblue42 жыл бұрын

    All your video tutorials are so good, you explain all the functions of each line or code, etc.Thank you.

  • @faizmk
    @faizmk2 жыл бұрын

    Ive playing with docker for past 1 month. This video definitely had help me understand better what those lines means. Now i know how to create docker compose for docker container that the dev team doesn't provide one. Appreciate your video

  • @deepakjoyjose8189
    @deepakjoyjose8189 Жыл бұрын

    This is the first time I am watching one of your videos. I loved how you explained the basics of docker compose in such a short amount of time. Thanks a lot for the amazing content!

  • @christianlempa

    @christianlempa

    Жыл бұрын

    Thank you so much! :)

  • @mohbkhaled6051
    @mohbkhaled6051 Жыл бұрын

    This channel is a real discovery thank you for this amazing explanation.

  • @GorkemYildirim
    @GorkemYildirim3 жыл бұрын

    I first used this method after version "3" yaml files were not accepted by portainer stacks without switching to swarm mode. Super useful additional information in this video.

  • @robertjyllhed3245
    @robertjyllhed32453 ай бұрын

    This was a really great video explaining better than I've seen before. Thank you for sharing and keep sharing. Love your content!

  • @christianlempa

    @christianlempa

    3 ай бұрын

    Glad it was helpful!

  • @JeanFrancoCaringi
    @JeanFrancoCaringi3 жыл бұрын

    Thank you very much! Just what I was looking for! Gracias!

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thank you! I'm glad it was helpful to you.

  • @ilya0x
    @ilya0x Жыл бұрын

    Awesome videos! Thank you for all your content! Learning Docker with you has been lots of fun :) ...and I'm very jealous of the look of your desktop! That menu up top and that data breach background...love it!

  • @ilya0x

    @ilya0x

    Жыл бұрын

    Could you possibly do a video on how to setup windows to look like yours?🤓

  • @christianlempa

    @christianlempa

    Жыл бұрын

    Thank you so much!

  • @christianlempa

    @christianlempa

    Жыл бұрын

    I've done some videos, maybe take a look at the YT search :) but as I'm not using windows anymore, there is nothing new I can show :D I'm sorry

  • @jaggyjut
    @jaggyjut2 жыл бұрын

    superb. Thank you for creating this tutorial.

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    You are welcome 😊

  • @krebs4817
    @krebs48173 жыл бұрын

    need a petition to have this man replace Mr Tiebe

  • @philmennenoh5946
    @philmennenoh59462 ай бұрын

    Thanks for your time.

  • @christianlempa

    @christianlempa

    2 ай бұрын

    Thanks for watching! :)

  • @bikushah9958
    @bikushah99582 жыл бұрын

    Man,you made it so simple!! Thanks

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Glad it helped!

  • @MR-vj8dn

    @MR-vj8dn

    3 ай бұрын

    Would you care to explain what it was you found difficult to understand before?

  • @anoopramachandran5197
    @anoopramachandran51973 жыл бұрын

    Great video! this was really helpful!

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Glad it was helpful!

  • @kumaryendamuri1599
    @kumaryendamuri15992 жыл бұрын

    Very understandable explanation.

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thx

  • @jordancode
    @jordancode Жыл бұрын

    Great video

  • @jonysnm
    @jonysnm3 жыл бұрын

    Thanks! Great video!

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Glad you liked it!

  • @vvagw5825
    @vvagw58252 жыл бұрын

    Спасибо! Ты лучший!

  • @linonator
    @linonator3 жыл бұрын

    I think the -d is to run the container in Detached mode, so that it runs in the background

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    exactly! :)

  • @PROGamersf36
    @PROGamersf362 жыл бұрын

    really good video! thank you !

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thanks! You're welcome

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w2 жыл бұрын

    Great example

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thanks!

  • @sagarnakrani2962
    @sagarnakrani29623 жыл бұрын

    Simple and understandable explanation, actually I was looking for an explanation of "links" in compose file. Could you please make another video on installing Magento? It would be really helpful for another developer also. Thanks.

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thanks 😊 I will check when I could add this to a video, will take some time. Cheers

  • @beesalniroula6146
    @beesalniroula61463 жыл бұрын

    thankyou for such a nice and clear tutorial 👍👍 could you please make another video on deploying laravel or any other framework app using dockerfile.

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thank you for the kind words 😀, more docker content is planned, thanks for the good suggestion!

  • @Ghaleon15
    @Ghaleon152 жыл бұрын

    Nice video, dude!

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thanks!

  • @JeanFrancoCaringi
    @JeanFrancoCaringi3 жыл бұрын

    I hope you post more videos about docker compose

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Yea, I've planned some more videos about it and also how to deploy them so stay tuned 😁👍

  • @aaronjameshorne
    @aaronjameshorne3 жыл бұрын

    Good video.

  • @autobahnmensch
    @autobahnmensch Жыл бұрын

    Really 😃 great!

  • @christianlempa

    @christianlempa

    Жыл бұрын

    Thanks! 😃

  • @ionution2009
    @ionution20092 жыл бұрын

    Thank you, just beginner, I have more to learning ! :)

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thanks mate! Keep it going :)

  • @haryan1627
    @haryan16273 жыл бұрын

    Great! can you share with us with your workspace theme?))

  • @kribo9604
    @kribo9604 Жыл бұрын

    Nice tut, looking for a docker setup for PHP?

  • @sanderaerts1178
    @sanderaerts11782 жыл бұрын

    U the best broo

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thank you :D

  • @mal-avcisi9783
    @mal-avcisi9783 Жыл бұрын

    this guy knows his shiat. bravo !

  • @rishiraj2548
    @rishiraj2548 Жыл бұрын

    Great

  • @user-ui6qh5id2e
    @user-ui6qh5id2e2 жыл бұрын

    Hi, thanks for your videos, they are awesome. I have a question in general about docker-compose...if I want to spin up two different Nextcloud instances that have access to the same database application but different DB names, how would that look? Can I just add this to the compose file with different names? Thanks a lot!!

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Sure, that will work. You need to make sure that both nextcloud instances can connect to the same database and then configure separate databases in the config.

  • @SebastianMBraun
    @SebastianMBraun Жыл бұрын

    I was looking for some tips how to setup a new network with self-defined IP-addresses with docker compose.

  • @hangchen
    @hangchen3 жыл бұрын

    Subscribed!!

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thank you bro 😀

  • @mazwenb5783
    @mazwenb57833 жыл бұрын

    Hi, can I install docker on a subfolder? The main subdomain that my team is using has already installed with Wordpress. So, we want to install a subfolder inside that subdomain. The subfolder will then contains a PHP based application that uses a database. Where to create a database from there? Please let me know. I am new to this. I usually use just basic shared hosting.

  • @mattjacobwilliams1721
    @mattjacobwilliams17213 жыл бұрын

    Ik kijk dit voor besturingssystemen 2, Tiebe thanks voor niks zeker?

  • @ernesto_quintana
    @ernesto_quintana3 жыл бұрын

    Could you go over the namespaces and cgroups ?

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    that's a good suggestion to cover it on a future video! I will add this to my backlog 😉

  • @richi_409
    @richi_409 Жыл бұрын

    What is the best way to install docker compose? I installed docker compose with using the docker repository (docker-compose-plugin), with that method I just get the Version v2.14.1. I searched in the docker documentation how to update/upgrade to a newer version, it just says to remove and install the docker-compose-plugin again. So how do I get ther Version 3? Is that just possible if you use another method of installing docker compose?

  • @codewithvikasmishra
    @codewithvikasmishra3 жыл бұрын

    May you please elaborate more on docker compose like what is the use of below:- Version: '3.7' services: Jwt_API: build: Context: . dockerfile: Dockerfile environment: - Any name Image: jwt_API:latest Container_name: jwt_API Volumes: - ".:/qbc" Ports: -"anyport" Why we have used build, context, dockerfile, containername etc above.

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    This is when you want to build your own docker images. I will make some tutorials on that in the future, but I don't know when.

  • @ohiasdxfcghbljokasdjhnfvaw4ehr
    @ohiasdxfcghbljokasdjhnfvaw4ehr3 жыл бұрын

    pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.') During handling of the above exception, another exception occurred:

  • @sudhadotsudha
    @sudhadotsudha2 жыл бұрын

    Very Nice , I am trying to create a container with OMV docker images. please suggest

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    it's hard to find the issue here in the comment section, so why don't you come to our Discord Community, and post some details about your setup, maybe somebody can help you out ;)

  • @sudhadotsudha

    @sudhadotsudha

    2 жыл бұрын

    @@christianlempa sure, do you have any forum or link to join the discord community

  • @TradersTradingEdge
    @TradersTradingEdge2 жыл бұрын

    Hi Christian. Thanks for the awesome work you do! I followed many of your videos, and they helped me a lot. If you have time to answer my question, that would be great, because I can't find a solution for my problem in Docker-Swarm. I've installed "Ghost CMS" on Docker Swarm, along with NGINX-Proxy-Manager. Everything works as expected, except the Ghost CMS. When I deploy Ghost as a service with multiple instances, I can't login. I get to the login page, put the user & pw and hit enter, and I'l get thrown back to the login screen once again. This does not happen if I deploy Ghost with only 1 instance, either as a service or container. I have a NFS share for the Worker Nodes & the Master, so they can access all the same data of Ghost. Do you have any Idea for me Christian? ;-) Have a great day and continue your fantastic job here on YT. Thanks cheers...

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    Thank you so much! ;) TBH, I haven't used Docker Swarm before so there is not much I can tell you unfortunately :(

  • @georgetarida5653
    @georgetarida56533 жыл бұрын

    What OS are you using? Can you make a video about your software setup?

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    I'm using Windows 10 and yeah I probably will do a video about my complete setup, so thank's for this suggestion :)

  • @madhavimourya1157
    @madhavimourya11572 жыл бұрын

    Like the background theme,please share the music

  • @krishnadasari9863
    @krishnadasari98633 жыл бұрын

    Hi Chritsian how can we build a customized image using docker-compose? I have my dockerfile using docker-compose need to build image

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    You need to specify a "build" attribute that points to the folder of where your Dockerfile and the source files are located

  • @SveinWisnaes
    @SveinWisnaes2 жыл бұрын

    Do you need Docker-compose to run a docker container? I managed to get Portainer up and running without installing Docker-compose. Could that be something new? Also heard that Kubernetes now comes with a very minimal way of running Docker...

  • @christianlempa

    @christianlempa

    2 жыл бұрын

    You Don't need docker compose to run containers, it just simplify deploying multiple containers. Kubernetes has their own implementation of a container runtime, they used docker in the past.

  • @crazythings9330

    @crazythings9330

    2 жыл бұрын

    @@christianlempa right now i'm working as Noc engineer , now i want to pursue devops tools ,can i learn docker and kubernates ,please suggest me tools to crack a job as devops engineer

  • @rudysal1429
    @rudysal1429 Жыл бұрын

    Tabs or spaces , how many do you need per indentation?

  • @christianlempa

    @christianlempa

    Жыл бұрын

    I'm sure you can use whatever you want, you just need to stick with one scheme.

  • @CristianMolina
    @CristianMolina3 жыл бұрын

    When you specify version "3" will it use 3.0 or latest "3.x" ?

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    It will always use the latest version you have currently installed, you only need to specify 3.x for backwards compatibility.

  • @trueskvoz
    @trueskvoz3 жыл бұрын

    hm what about docker-sync ?

  • @GamerForeverChannel
    @GamerForeverChannel Жыл бұрын

    which os did you use?

  • @christianlempa

    @christianlempa

    Жыл бұрын

    Recently, I switched from Windows to MacOS

  • @wtc7862
    @wtc78623 жыл бұрын

    [docker_entrypoint:crit] [pid 1] DOCKER: mkdir /data/etc: permission denied :D DOCKER ist so GEIL

  • @ForrestRhoads
    @ForrestRhoads3 жыл бұрын

    Christian, I think your videos are great, and I enjoy your choice of topics. But why do you caption your channel, "Become an IT Professional?" I am a 71 year old retired lawyer, and I have no interest in becoming an IT Professional. However, I think your tutorials and coverage are great, and I will use many of the things you've taught me on my home network. Vielen Dank für die ausgezeichnete Informationen!

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thank you so much for the kind words 🥰, this is a good question! That's why most of my content is geared towards common IT industry standards and also educates people in what they need in IT jobs. I also want to cover more IT career tips and certs. However, some of my viewers are not working in IT but use this for home lab and projects, which is totally fine and I also want to do more content for home labs as well. But I get it, the caption is something I probably will remove from my branding in the future. Vielen Dank für deine tollen Kommentar!

  • @ohiasdxfcghbljokasdjhnfvaw4ehr
    @ohiasdxfcghbljokasdjhnfvaw4ehr3 жыл бұрын

    dont ask me to subscribe before I've watched your video.

  • @richardfearing4751
    @richardfearing47513 жыл бұрын

    The background music was an issue. I wouldn't recommend playing music during class while the professor is teaching.

  • @rahul_bali

    @rahul_bali

    3 жыл бұрын

    classical very light music is fine, but not upbeat.

  • @moin6747
    @moin67473 жыл бұрын

    great video. the lighting in your face looks a bit off

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    Thanks man 😊

  • @otegaawharitoma5340
    @otegaawharitoma5340 Жыл бұрын

    i can hardly see it pls change the back ground

  • @luizgoss
    @luizgoss3 жыл бұрын

    sorry, not works-> sudo: docker-compose: comand not found

  • @christianlempa

    @christianlempa

    3 жыл бұрын

    You may check out the docu about how to install docker-compose. Alternatively try out installing it via package management.

  • @easyvideott7505
    @easyvideott7505 Жыл бұрын

    docker commands should not be run as root user!

  • @SebastianMBraun
    @SebastianMBraun Жыл бұрын

    MariaDB > MySQL