Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.48 KB

README.md

File metadata and controls

36 lines (31 loc) · 1.48 KB

rails_docker_like_evilmartians

Sample repo for rails + docker + docker-compose + dip, with respect to Evilmartians' configs

Assumed environment

  • macOS: 11.2.3(Big Sur)
  • Docker for Mac
    • Docker: 20.10.5
    • Docker-compose: 1.28.5
    • (Add Dockerhub account)
  • Rails: 6.1.3.1
  • Ruby: 3.0.1
  • dip: 7.0.1
  • Git: 2.31.1

Setup

  1. Perform gem install dip to install dip.
  2. Perform git clone to clone the repository.
  3. Rename yourapp_docker in docker-compose.yml to your project name.
  4. docker-compose build to build
  5. dip sh to login the container.
    1. Perform rails new . with your preferential options.
    2. If needed, perform bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java to supress the warning.
    3. rm -rf vendor to remove vendor/ directory.
    4. exit to logoff from the container.
  6. git checkin to commit.
  7. dip provision to setup database connections and envs.
  8. git checkin to commit the updated schema.
  9. dip minitest to perfom the initial test. 1-. add config.hosts << "localhost" and config.web_console.whitelisted_ips = '0.0.0.0/0' to config/environments/development.rb
  10. git checkin to commit the change.
  11. dip rails s to start Rails.
  12. Open http://localhost:3000/ on your browser to show the welcome page.