Skip to content

evilmartians/ruby-on-whales

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby on Whales

This repository contains an example dockerized Ruby on Rails development configuration based on the Ruby on Whales blog post.

Example configuration

See the example folder.

Interactive generator

We also provide an interactive generator for Rails apps to quickly setup a dockerized environment for your app. Just run the following command and follow the instructions:

bundle exec rails app:template LOCATION='https://railsbytes.com/script/z5OsoB'

You can also run it via Ruby Bytes (so you can dockerize a Rails app without installing it on your host machine):

rbytes install https://railsbytes.com/script/z5OsoB

Tips & Tricks

Pry / IRB history support

To persiste Pry or IRB history, you must configure them to store it in the history volume.

For IRB, add the following to your .irbrc file:

IRB.conf[:SAVE_HISTORY] = 10_000 # Maximum number of lines to save in history
IRB.conf[:HISTORY_FILE] = ENV.fetch("IRB_HISTFILE", "#{ENV["HOME"]}/.irb-history")

Then, in the compose.yml, specify the IRB_HISTFILE environment variable:

x-backend:
  environment:
    # ...
    IRB_HISTFILE: /usr/local/hist/.irb_history

Similarly, for Pry, add the following to your .pryrc file:

Pry.config.history_save = true
Pry.config.history_file = ENV.fetch("PRY_HISTFILE", "#{ENV["HOME"]}/.pry-history")

Then, in the compose.yml, specify the PRY_HISTFILE environment variable:

x-backend:
  environment:
    # ...
    PRY_HISTFILE: /usr/local/hist/.pry_history

See also

License

The code is available as open source under the terms of the MIT License.

About

Ruby on Whales example and templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7