Articles → DOCKER → Docker Compose

Docker Compose






Purpose





Install Docker





Install Docker-Compose




sudo apt  install docker-compose



Docker-Compose.Yml




version: '3'

services:
  nginx:
    image: nginx:latest
    container_name: my_nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./apps:/etc/nginx/apps:ro
    restart: always





Run The Complete Application




docker-compose up



Output


Picture showing the output of docker compose



--Scale Option




version: '3'

services:
  nginx:
    image: nginx:latest
    container_name: my_nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./apps:/etc/nginx/apps:ro
    restart: always




docker-compose up --scale nginx=3





Posted By  -  Karan Gupta
 
Posted On  -  Monday, December 25, 2023

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250