Public | Automated Build

Last pushed: a year ago
Short Description
Simple ruby on rails development container.
Full Description

Demo Ruby on Rails application


How to setup a complete Rails setup on Docker.

Requirements

So need to install the following softwares:

  • git
  • Docker
  • docker-compose

Or grab yourself the Docker toolbox

This repository

Grab it.

$ git clone https://github.com/HE-Arc/demo-rails-application ror
$ cd ror

Containers

Now, the funny part that creates and starts the containers.

# if you uncomment the docker-composer.yml
$ docker-compose build
# otherwise:
$ docker build -t greut/rails -f build/Dockerfile .
$ docker-compose up -d
$ docker-compose logs web

Entering the container

We will work from the container called web. Docker-compose puts a prefix
to it (the name of the directory) and a suffix, a counter. Hence, our web
container is identified by ror_web_1.

$ docker-compose web /bin/sh
/ mv /etc/profile.d/color_prompt /etc/profile.d/color_prompt.sh
/ # su ruby
/ $ . /etc/profile
/ $ export PATH = $BUNDLE_BIN:$PATH
$ ruby@ror:/# cd /usr/src/app
$ ruby@ror:/usr/src/app$ rails -v
Rails 5.0.0.1
$ bundle install
$ rails db:create db:migrate db:seed
$ foreman start
Docker Pull Command
Owner
greut
Source Repository