How to install docker compose on AWS instance?

How to install docker compose on AWS instance?

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.

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let Us Talk About Your AWS Development Requirements

    Have queries about your AWS project ideas and concepts? Please drop in your project details to discuss with our AWS experts, professionals and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project