Sign inSign up

greut/rails

By greut

Updated about 10 years ago

Simple ruby on rails development container.

Image
1

953

greut/rails 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 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

Tag summary

Content type

Image

Digest

sha256:5f53a0f50

Size

231.6 MB

Last updated

about 10 years ago

docker pull greut/rails