Rejig introduction

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-02-16 19:21:17 +00:00
commit 5e8bcd2d29
2 changed files with 44 additions and 36 deletions

View file

@ -3,17 +3,30 @@ Docker Compose
[![wercker status](https://app.wercker.com/status/d5dbac3907301c3d5ce735e2d5e95a5b/s/master "wercker status")](https://app.wercker.com/project/bykey/d5dbac3907301c3d5ce735e2d5e95a5b)
Fast, isolated development environments using Docker.
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.
Define your app's environment with Docker so it can be reproduced anywhere:
Compose is great for development environments, staging servers, and CI. We don't
recommend that you use it in production yet.
FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
CMD python app.py
Using Compose is basically a three-step process.
Define the services that make up your app so they can be run together in an isolated environment:
First, you define your app's environment with a `Dockerfile` so it can be
reproduced anywhere:
```Dockerfile
FROM python:2.7
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code
CMD python app.py
```
Next, you define the services that make up your app in `docker-compose.yml` so
they can be run together in an isolated environment:
```yaml
web:
@ -22,21 +35,18 @@ web:
- db
ports:
- "8000:8000"
- "49100:22"
db:
image: postgres
```
(No more installing Postgres on your laptop!)
Lastly, run `docker-compose up` and Compose will start and run your entire app.
Then type `docker-compose up`, and Compose will start and run your entire app.
Compose has commands for managing the whole lifecycle of your application:
There are commands to:
- start, stop and rebuild services
- view the status of running services
- tail running services' log output
- run a one-off command on a service
* Start, stop and rebuild services
* View the status of running services
* Stream the log output of running services
* Run a one-off command on a service
Installation and documentation
------------------------------