plum -> fig
This commit is contained in:
parent
4d35d47969
commit
0cafdc9c6c
21 changed files with 33 additions and 33 deletions
38
README.md
38
README.md
|
|
@ -1,9 +1,9 @@
|
|||
Plum
|
||||
Fig
|
||||
====
|
||||
|
||||
**WARNING**: This is a work in progress and probably won't work yet. Feedback welcome.
|
||||
|
||||
Plum is tool for defining and running application environments with Docker. It uses a simple, version-controllable YAML configuration file that looks something like this:
|
||||
Fig is tool for defining and running application environments with Docker. It uses a simple, version-controllable YAML configuration file that looks something like this:
|
||||
|
||||
```yaml
|
||||
web:
|
||||
|
|
@ -20,13 +20,13 @@ Installing
|
|||
----------
|
||||
|
||||
```bash
|
||||
$ sudo pip install plum
|
||||
$ sudo pip install fig
|
||||
```
|
||||
|
||||
Defining your app
|
||||
-----------------
|
||||
|
||||
Put a `plum.yml` in your app's directory. Each top-level key defines a "service", such as a web app, database or cache. For each service, Plum will start a Docker container, so at minimum it needs to know what image to use.
|
||||
Put a `fig.yml` in your app's directory. Each top-level key defines a "service", such as a web app, database or cache. For each service, Fig will start a Docker container, so at minimum it needs to know what image to use.
|
||||
|
||||
The simplest way to get started is to just give it an image name:
|
||||
|
||||
|
|
@ -35,26 +35,26 @@ db:
|
|||
image: orchardup/postgresql
|
||||
```
|
||||
|
||||
You've now given Plum the minimal amount of configuration it needs to run:
|
||||
You've now given Fig the minimal amount of configuration it needs to run:
|
||||
|
||||
```bash
|
||||
$ plum start
|
||||
$ fig start
|
||||
Pulling image orchardup/postgresql...
|
||||
Starting myapp_db_1...
|
||||
myapp_db_1 is running at 127.0.0.1:45678
|
||||
<...output from postgresql server...>
|
||||
```
|
||||
|
||||
For each service you've defined, Plum will start a Docker container with the specified image, building or pulling it if necessary. You now have a PostgreSQL server running at `127.0.0.1:45678`.
|
||||
For each service you've defined, Fig will start a Docker container with the specified image, building or pulling it if necessary. You now have a PostgreSQL server running at `127.0.0.1:45678`.
|
||||
|
||||
By default, `plum start` will run until each container has shut down, and relay their output to the terminal. To run in the background instead, pass the `-d` flag:
|
||||
By default, `fig start` will run until each container has shut down, and relay their output to the terminal. To run in the background instead, pass the `-d` flag:
|
||||
|
||||
```bash
|
||||
$ plum start -d
|
||||
$ fig start -d
|
||||
Starting myapp_db_1... done
|
||||
myapp_db_1 is running at 127.0.0.1:45678
|
||||
|
||||
$ plum ps
|
||||
$ fig ps
|
||||
Name State Ports
|
||||
------------------------------------
|
||||
myapp_db_1 Up 5432->45678/tcp
|
||||
|
|
@ -62,7 +62,7 @@ myapp_db_1 Up 5432->45678/tcp
|
|||
|
||||
### Building services
|
||||
|
||||
Plum can automatically build images for you if your service specifies a directory with a `Dockerfile` in it (or a Git URL, as per the `docker build` command).
|
||||
Fig can automatically build images for you if your service specifies a directory with a `Dockerfile` in it (or a Git URL, as per the `docker build` command).
|
||||
|
||||
This example will build an image with `app.py` inside it:
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ This example will build an image with `app.py` inside it:
|
|||
print "Hello world!"
|
||||
```
|
||||
|
||||
#### plum.yml
|
||||
#### fig.yml
|
||||
|
||||
```yaml
|
||||
web:
|
||||
|
|
@ -91,7 +91,7 @@ web:
|
|||
|
||||
### Getting your code in
|
||||
|
||||
If you want to work on an application being run by Plum, you probably don't want to have to rebuild your image every time you make a change. To solve this, you can share the directory with the container using a volume so the changes are reflected immediately:
|
||||
If you want to work on an application being run by Fig, you probably don't want to have to rebuild your image every time you make a change. To solve this, you can share the directory with the container using a volume so the changes are reflected immediately:
|
||||
|
||||
```yaml
|
||||
web:
|
||||
|
|
@ -118,8 +118,8 @@ web:
|
|||
This will pass an environment variable called `MYAPP_DB_1_PORT` into the web container, whose value will look like `tcp://172.17.0.4:45678`. Your web app's code can use that to connect to the database. To see all of the environment variables available, run `env` inside a container:
|
||||
|
||||
```bash
|
||||
$ plum start -d db
|
||||
$ plum run web env
|
||||
$ fig start -d db
|
||||
$ fig run web env
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -152,12 +152,12 @@ web:
|
|||
Running a one-off command
|
||||
-------------------------
|
||||
|
||||
If you want to run a management command, use `plum run` to start a one-off container:
|
||||
If you want to run a management command, use `fig run` to start a one-off container:
|
||||
|
||||
```bash
|
||||
$ plum run db createdb myapp_development
|
||||
$ plum run web rake db:migrate
|
||||
$ plum run web bash
|
||||
$ fig run db createdb myapp_development
|
||||
$ fig run web rake db:migrate
|
||||
$ fig run web bash
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue