Sign inSign up

greut/demo-rails-application

By greut

Updated almost 9 years ago

Demo Ruby on Rails application for Web Application course.

Image
0

935

greut/demo-rails-application repository overview

Demo Ruby on Rails application

Build Status Docker Pulls

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 exec 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.1.4
$ bundle install
$ rails db:create db:migrate db:seed
$ foreman start

Tag summary

Content type

Image

Digest

Size

205.7 MB

Last updated

almost 9 years ago

docker pull greut/demo-rails-application