docker -compose code example

Example 1: docker compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Example 2: docker container

docker container ls -a
docker ps -a

docker container stop [ID]

docker container run -d -p 80:80 --name nginx-server nginx

Example 3: docker compose

version: '2.0'
services:
  web:
    build: .
    ports:
    - "5000:5000"
    volumes:
    - .:/code
    - logvolume01:/var/log
    links:
    - redis
  redis:
    image: redis
volumes:
  logvolume01: {}