Categories
programming web server

Docker Compose

Compose is a tool for defining and running multi-container Docker applications. With Compose, you can use YAML file to configure your application’s services. Then, with a single command, you can create and start all the services from your configuration.

  • define your app’s environment with Dockerfile
  • define services (containers with additional stuff) that make up your app in docker-compose.yml
  • run docker-compose up so Compose can start and run your entire app

Commands

docker-compose ps
docker-compose up -d
docker-compose stop
docker-compose down
docker-compose rm [name]
docker-compose build [name]
or docker-compose build --no-cache
docker-compose up -d
docker-compose logs --follow [service_name]
docker-compose exec [service_name] [command]

Source: freeCodeCamp

Leave a Reply

Your email address will not be published. Required fields are marked *