Skip to content

Mashpy/rails-7-docker-template-with-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby on Rails 7 docker template with mysql

  1. First clone the project
 git clone https://github.com/Mashpy/rails-7-docker-template-with-mysql.git
  1. Rename the project name as your wish
 mv rails-7-docker-template-with-mysql your_project_name
  1. Change directory -
 cd your_project_name
  1. Update your rails version on the Gemfile -
source 'https://rubygems.org'
gem 'rails', '7.0.3'
  1. Update Ruby version on Dockerfile -
FROM  ruby:3.1.2-slim
  1. Now install new rails app -
 docker-compose run app rails new . --force --database=mysql --skip-bundle
  1. Build the docker image -
 docker-compose build
  1. Update database details on config/database.yml file.
default: &default
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: root
  password: "root"
  host: mysql

development:
  <<: *default
  database: dev

test:
  <<: *default
  database: dev
  1. Run -
 docker-compose up
  1. Browse http://localhost:3000 Ruby on rails 7.0.3 docker with mysql

About

You can start new Rails 7 project with Docker

Resources

Stars

Watchers

Forks