If this is not the case, I invite you to refer to my previous article. Note: This tutorial takes into consideration that you have already installed Docker on your computer and that you have the basics. This sentence must be retrieved by a program (client) in Python that will display the sentence. The objective of this tutorial is to create a small website (server) in Python that will contain a sentence. Now that you know what docker-compose is going to be used for, it’s time to create your first client/server-side application! Now let’s create your first client/server-side application with Docker-Compose All you have to do now is make a few configurations and load the backup of your database to finalize the migration. If you had used a docker-compose, in only a few commands you would have deployed your entire architecture on your new server. So you’re going to have to migrate and reconfigure your services one after the other, hoping nothing has been forgotten. Unfortunately, you didn’t use docker-compose.
So, you decide to migrate your entire software to another machine. You are beginning to be successful and your server is no longer sufficient. These two sites interact with the same database. The second is dedicated to customer support. The first allows stores to create their online store in just a few clicks. Imagine, you are the proud creator of your web software. I will give you a concrete case study that will prove that you need it. This tool can become very powerful and allow you to deploy applications with complex architectures very quickly. Docker (individual container) VS Docker-Compose (several containers) A typical use case This tool offers the same features as Docker but allows you to have more complex applications. Difference between Docker and Docker-Composeĭocker is used to manage an individual container (service) for your application.ĭocker-Compose is used to manage several containers at the same time for the same application.
For example, if you create a website that needs to connect to your database to authenticate users (here 2 services, website and database).ĭocker-compose offers you the possibility to launch all these services in a single command. However, how do you know if you need Docker-Compose? It’s very simple - if your application requires several services to run, you need this tool. Unfortunately, when you are a developer you rarely create a stand-alone program (a program that does not require any other services to run, such as a database). To make it simple, this tool is implemented to solve architectural problems in your projects.Īs you may have noticed in my previous article, we created a simple program that displayed “Docker is magic!” when it was launched. What is Docker-Compose?ĭocker-Compose is a tool provided by Docker. After a short introduction on what Docker is and why to use it, you will be able to create your first application with Docker.
You are a developer and you want to start with Docker? This article is made for you.
If not, don’t panic! I suggest that you read my first article to discover Docker and learn how to create your first application.Ī beginner’s guide to Docker - how to create your first Docker application This article takes into consideration that you know the basics of Docker. You are a developer and you want to discover docker-compose? This article is made for you.Īfter a short introduction on Docker-Compose, you will be able to create your first client/server-side application with Docker.