Lab 31 :Docker Compose
- Get link
- X
- Other Apps
Docker Compose
What is the Docker Compose why we use?
Docker Compose is a tool for defining and running
multi container Docker applications with
Compose,you use a YAML file to configure
you are applications services.Then, with single,command,You create and start
all services from your configuration.
Compose works
in all environments:Production,Staging,Development,testing,as well as CL work
flows.
Pre-Requisities:
Make sure you have already installed both docker
Engine and Docker Compose .Dont need to install python or redis,as both are
provided by docker images.
Launch an instance and allow 6379 port for
Redis.otherwise you get an error.
Step1: Login to the server
Install docker and docker compose
Htttps://docs.docker.com/compose/install/
Follow the above link to install docker compose
Now first install Docker
#yum install docker
Start the service
#systemctl start docker
Now install docker compose
After installing docker and docker compose
Now create a directory for the project.
Go to the Directory
Create a file called app.py in your project directory and paste this in:
Create another file called requirements.txt in your project
directory and paste this in:
In your project directory,create a file named Dockerfile and paste the following;
0
Create a file
called docker –compose.yml in your project directory and paste the following
Now build and run the app with docker compose
#docker –compose up
Enter https://0.0.0.0.5000/in
a browser to see the applications running
You will get a page like this.
- Get link
- X
- Other Apps















Comments
Post a Comment