Skip to content

Docker related files for setting up a Rails development environment

Notifications You must be signed in to change notification settings

NgariNdungu/rails-on-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to:

New App

  1. clone this repository
  2. cd into created directory
  3. run docker-compose build
  4. create a new rails app in the directory with:
docker-compose run --no-deps app rails new . -d postgresql 
  1. Edit config/database.yml and set up the host and username:
...
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  host: db
  username: postgres
...
  1. Generate the databases with docker-compose run app bundle exec rails db:create
  2. Start the app with docker-compose up
  3. Nagivate to http://localhost on your browser. You should see the rails welcome page.

Existing App

  1. Copy the Dockerfile, docker-compose.yml and entrypoint.sh files into the root of your app.
  2. Build the image with docker-compose build
  3. Follow from step 5 above

About

Docker related files for setting up a Rails development environment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published