January 8, 2021 / Nirav Shah
Docker Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you can create and start all the services from your configuration.
Step 1: First we Download and Install Docker Compose
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
Step 2: Change Permissions
chmod +x /usr/local/bin/docker-compose
Step 3: Check Docker Compose version
docker-compose --version
Let see how to use compose the file with an example.
Fist first let’s see how docker file look like.
version: "3.8" services: web: build: ports: - "5000:5000" volumes: - .:/code - logvolume01:/var/log links: - redis redis: image: redis volumes: logvolume01: {}
And save it docker-compose.yml
And hit the below command
#docker-compose up -d
And your Redis is running in port number 5000. To read more on Docker Compose, visit the Documentation Page.
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.