Rails Docker ~ Part 2 ~

For the time being, try running the Rails application

First of all, to remember what the environment depends on and what was annoying. Let's clone the Rails application and run it in the local environment.

■sample project https://github.com/k-tetsuhiro/rails_docker_sample

This is a sample app created with ruby 2.7.2 and Rails Try git clone this wherever you like. Bring this to the point where you can run it with bundle exec rails s! I think that various problems will come out before moving it.

Problems that come up

First of all, is 2.7.2 included in the local Ruby version? If you are using rbenv, you can check with rbenv versions.

$ rbenv versions
* 2.7.2 (set by /Users/kakuno/.rbenv/version)

How about that? If 2.7.2 is not included, you will first need to ** install ruby2.7.2 in your local environment **.

** Environmental dependence has come out at once! !! ** **

Similar environmental dependence will appear in the future

I think that it will be dependent on such an environment of local by the time it starts ・ Ruby version ・ Rails version ・ MySQL version ・ Yarn version etc...

Let's solve it with the environment-dependent docker!

That's why docker comes out here!

Rails application that someone has set up ** Save it as an image! !! ** **

If you include all the environments (Ruby, Rails, MySQL, etc ...) into an image, you won't be environment-dependent in the first place! It is an image!

As a further advantage, regardless of whether the local environment is Mac or Windows, ** Ruby and Rails are actually included in docker's image **, so it works on any machine!

Try running with docker

I feel a great advantage in running with docker! So next time, how can I run my current Rails application with docker? I will explain here.

Recommended Posts

Rails Docker ~ Part 1 ~
Rails Docker ~ Part 2 ~
Introduction of Docker --Part 1--
Rails Docker environment construction
Docker x Rails 6 (memo)
Rails deploy with Docker
Rails learning day 2 part 2
Rails learning day 1 part 3
Rails learning day 3 part 2
Rails learning Day 1 Part 2
[Rails 6] Dockerize existing Rails apps [Docker]
Run Rails whenever with docker
[Docker] Rails 5.2 environment construction with docker
[Docker] Use whenever with Docker + Rails
Rails + MySQL environment construction with Docker
Introduction to Linux Container / Docker (Part 1)
Rails 5 Code Reading Part 2 ~ Action View ~
Build environment with vue.js + rails + docker
Docker + rails + Vue.js localhost connection refused
Build Rails environment with Docker Compose
Introduction to Linux Container / Docker (Part 2)
Rails on Docker environment construction procedure
[Environment construction with Docker] Rails 6 & MySQL 8
Deploy Rails on Docker to heroku
docker memo
[Rails g.error]
Rails basics
Rails Review 1
Rails API
Rails migration
Deployed using Docker + Rails + AWS (EC2 + RDS)
spring × docker
[Rails] first_or_initialize
About Docker
[Rails] Rails new cannot be done from Docker
rails tutorial
Building Rails 6 and PostgreSQL environment with Docker
Rails 5 Code Reading Part 1 ~ ActiveRecord new Method ~
Docker Intellij
Create Rails 6 + MySQL environment with Docker compose
[Rails] How to use rails console with docker
About Rails 6
Migrate existing Rails 6 apps to Docker environment
Deploy to heroku with Docker (Rails 6, MySQL)
Docker basics
Rails foundation
Rails memorandum
rails tutorial
rails tutorial
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
Docker installation
About Docker
Docker command
Docker memorandum
[Rails] devise
Show Better Errors in Rails + Docker environment
Understand Docker
rails tutorial
Docker memorandum
rails tutorial