LRUG talk - Docker Rails AWS Elastic Beanstalk - "puppies" demo app
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

AWS ElasticBeanstalk Ruby on Rails Docker

This is a Demo application related to the talk AWS Elastic Beanstalk & Docker for Rails developers

>>>>Talk Video<<<<

Pre-built application (puppies app) Docker images:


Clone this repo and cd into it:

$ git clone
$ cd docker_rails_aws_elasticbeanstalk_demmo_app

Once the application is running and is successfully connected to DB be sure to run rake db:seed inside the container. You can leart out how to run commands inside Docker container here.

Running production application locally

Production version of docker-compose.yml is located in the root folder of this git repo.

to run in production mode, all you need to do:

  1. install Docker and docker-compose
  2. $ docker-compose up or $ sudo docker-compose up
Running application locally (development mode)

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

Running production application on AWS Elastic Beanstalk

Elastic Beanstalk's is located in ./aws_elastic_beanstalk.

In that folder is separate file containing useful information on AWS Elastic Beanstalk CLI

Steps to lunch "puppies" demo application in AWS Elastic Beanstalk:

Step 1: Configure new Docker based AWS Beanstalk Enviroment, PostgreSQL RDS, Redis Elastic Cache and ensure the Security Groups are set in a way that endpoints can communicate to each other. In order to achieve this you can follow steps in this article:

Web interface deployment:

Step 2:: Once in the configured EB environment, from web interface Click "Upload" and chose ./aws_elastic_beanstalk/

CLI deployment:

Step 2:: Install and configure EB CLI. You can find my instructions on EB CLI here

Step 3: $ cd ./aws_elastic_beanstalk and $ eb deploy

Nginx proxy container

Nginx image source code located in ./nginx folder.

How lunch stuff / debug app inside the Docker containers

From host machine you can lunch:

bash docker/    # enter bash in the puppies_web container
bash docker/ # enter rails console in the puppies_web container
bash docker/     # pry debugger - where you introduce `binding.pry`

bash docker/      # enter bash in the proxy container

Or manually type:

docker ps
docker exec -it xxIdOfAContainerxx  bash

How to Build Docker image and how to push a change to Docker registry

docker-compose build
docker-compose push

Other Resources

How the Ruby on Rails application was generated
mkdir docker_rails_aws_elasticbeanstalk_demo_app
cd docker_rails_aws_elasticbeanstalk_demo_app

gem install bundler rails

rails new puppies --skip-test --skip-action-mailer

rake db:create
rake db:seed