-2

I have this docker-compose.yml:

ports:
  - "3000:3000"
environment:
  RAILS_ENV: development
  • What does the RAILS_ENV do?
  • What difference does it make, when RAILS_ENV is changed to development?
  • How does the change affect the automated build?
0

RAILS_ENV is en environment variable. Environment variable is a setting which may be read inside the container. Though, environment variables do exist on most of the operating systems https://en.wikipedia.org/wiki/Environment_variable So the only specific here is that you can set an environment variable for the container and pass some values inside that way.

I assume you are working with docker-compose example for Ruby on Rails. So for the meaning of the RAILS_ENV value you should refer to the Ruby on Rails documentation https://guides.rubyonrails.org/configuring.html#rails-environment-settings

  • yeah i use docker compose for Ruby on Rials . so How does the change affect the automated build? @Petr Chloupek – omar amine Apr 25 at 6:55
  • I don't think it should affect the build in any way. It is a runtime variable and it is set in the docker-compose which means it is set for the run time not for the build time. If you mean what it affects in the RoR application then it really depends on how you set the environment in the application richonrails.com/articles/creating-a-custom-rails-environment this is just a framework for giving the possibility to change settings based on where the application is running. Just open the sources and see what is there in your case. – Petr Chloupek Apr 25 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.