Docker: Compose

Compose is a tool for defining and running complex applications with Docker. With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running. Using Compose is basically a three-step process:

  • Define your app’s environment with a Dockerfile so it can be reproduced anywhere
  • Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment
  • Run docker-compose up and Compose will start and run your entire app

More info can be found here.

Simple usage

docker run -p 80:80 -v www:/var/www/example.com/public_html -t -i linode/lamp /bin/bash

A more easy way of typing this command:

symlearn:
  image: linode/lamp
  ports:
   - 80:80
  volumes:
   - www:/var/www/example.com/public_html
 
docker-compose run symlearn

Leave a Reply