hey what’s up guys, after watching this video you’ll have an idea of what it takes to run a Rails app with docker and docker-compose.

(Sorry for aspect ratio, going to use proper resolution on retina display next time! (facepalm))

Commands executed as part of this video

Clone rails app

git clone git@github.com:akurkin/lightweight_rails_app.git

Create docker-machine on local with virtualbox provider

docker-machine create -d virtualbox --virtualbox-memory 2048 lra

Configure docker client to connect to new docker host

docker-machine env lra
eval $(docker-machine env lra)

Check docker host info

docker info

Launch services using docker-compose

docker-compose -f docker-compose.development.yml up -d

Check running containers

docker-compose -f docker-compose.development.yml ps

Create database, load schema and seed it

docker-compose -f docker-compose.development.yml run web rake db:create db:schema:load db:seed

Get ip address of docker host

docker-machine ip lra

Run specs in a container

docker-compose -f docker-compose.development.yml run -e RAILS_ENV=test web rake db:create db:migrate
docker-compose -f docker-compose.development.yml run -e RAILS_ENV=test web rspec