Skip to content

exorql/docker-rails-dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-rails-dev

Docker template for Rails app or Rails + MySQL development.

Versions

  • Ruby 2.5.0
  • Rails 5.2.0
  • MySQL 5.7

Usage

  1. Copy env.sample to .env and edit the .env
$ cp .env.sample .env
  1. Run following command
$ docker-compose run app rails new . --force --database=mysql --skip-bundle
  1. Modify config/database.yml as following
default: &default
  adapter: mysql2
  encoding: utf8
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password: xxxxxx # <- Modify here.
  host: db # <- Modify here.
  1. Run
docker-compose up -d
  1. Finally, you need to create the database. Run
docker-compose run app bin/rake db:create
  1. Open http://localhost:3000/

To stop container then run following command

$ docker-compose stop

To start container again then run following command

$ docker-compose start

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published