Get Started

Products

Docker is the open platform to build, ship and run any app, anywhere.

Docker Compose

Get Compose | Read Docs | Contribute to Compose

Define and run multi-container applications

$ docker-compose up
  Pulling image redis...
  Building web...
  Starting composetest_redis_1...
  Starting composetest_web_1...
  redis_1 | [8] 02 Jan 18:43:35.576 # Server started,
  Redis version 2.8.3

  web_1 | * Running on http://0.0.0.0:5000/
$ |

Distributed applications are made up of many small applications that work together. Docker turns these applications into individual containers that are linked together. Instead of having to build, run and manage each individual container, Docker Compose is a tool that allows you to define your multi-container application and all of its dependencies in single file, then spin your application up in a single command. Changes to your application can be managed from the file and files are easily shared with others for collaboration.


  • Save Time

    Simply define your application with Docker and everything will spin up super-fast in containers.

  • Completely self-contained

    Compose defines your entire application with all of its dependencies. No more installing Postgres on your computer.

  • Portability across environments

    Define your application with Compose once in development but use the same configuration to run the application on other developer machines and in Test and Continuous Integration.

  • Easily collaborate with others

    Compose applications can be easily shared with other members of your team and other teams. Just run “docker-compose up” and your application’s running.


Get started in 3 steps:

1. Write your Docker file
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code
CMD python app.py
2. Write your docker-compose.yml file
web:
  build: .
  links:
  - db
  ports:
  - "8000:8000"

db:
  image: postgres
3. Run your app
$ docker-compose up