How to setup a complete Rails setup on Docker.
So need to install the following softwares:
Or grab yourself the Docker toolbox
Grab it.
$ git clone https://github.com/HE-Arc/demo-rails-application ror
$ cd ror
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
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
Content type
Image
Digest
sha256:5f53a0f50…
Size
231.6 MB
Last updated
about 10 years ago
docker pull greut/rails