Skip to content

devteds/e1-rails-on-docker

 
 

Repository files navigation

Rails on Docker

Update: Check out the new course on setting up a Rails local development environment with Docker using DevContainers

This is an old episode and source code. Instead, I suggest you check out the new way of working with Docker for Rails applications

Episode Video Link

Old code & episode

Learn how to use docker / docker compose to create and run rails application.

Episode video link

Tested on

  • Mac OSX - 10.10.5
  • Docker - 1.12.1
  • Docker compose - 1.8.0

Instructions/commands

mkdir ~/projects/noteapp
cd ~/projects/noteapp
# Create Gemfile
# Create Dockerfile
# Create docker-compose.yml
docker-compose run app rails new . --force --database=mysql --skip-bundle
docker-compose build
docker-compose up
# http://localhost:3001
docker-compose run --rm app rails g scaffold note title body:text
docker-compose run --rm app rake db:migrate
# http://localhost:3001/notes

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 65.9%
  • HTML 26.9%
  • JavaScript 3.3%
  • CSS 2.0%
  • Dockerfile 0.7%
  • CoffeeScript 0.6%
  • SCSS 0.6%