SpiderOak/crypton — pull request #322 by ecto (2014-10-12 13:01:46+00:00)
Title: Docker compatibility improvements

This has been pushed to https://registry.hub.docker.com/u/spideroak/crypton/

First, this branch adds two commands to the `crypton-server` CLI:

````
crypton-server db:init
crypton-server db:drop
````

This provides similary functionality to `make setup` or `make clean`, but without shell scripts. It will utilize the config provided by argument or the default config file. If the `-d` flag is specified, the CLI will look for environment variables provided by docker when a `--link` is invoked, allowing you to do the following:

````bash
# start redis
sudo docker run --name crypton-redis -d redis
# start postgres
sudo docker run --name crypton-postgres -d postgres
# initialize the database
sudo docker run --link crypton-redis:redis --link crypton-postgres:db -it spideroak/crypton -d db:init
# start a crypton server
sudo docker run --link crypton-redis:redis --link crypton-postgres:db -it spideroak/crypton
^C # kill it
# drop the database
sudo docker run --link crypton-redis:redis --link crypton-postgres:db -it spideroak/crypton -d db:drop
````

The end goal of this is to make initial server configuration simpler. This paves the way toward a unified `crypton` (as opposed to `crypton-server`) CLI being used to manipulate docker instances, in addition to its planned backend service functionality.