简体   繁体   中英

How to create a multi-app Ruby on Rails shared environment

I am looking to create a shared hosting environment allowing for multiple RoR apps to be running well isolated from one another (and the underlying os), running different versions of RoR as required.

My question is can this be done without having to resort to OpenVZ/Virtualisation?

If so, would the following approach be suitable - what would be required to make apps well isolated from each other and the OS?

  • NGinx , single instance for load balancing
  • Unicorn , multiple instances started by NGinx to handle requests (capable of running different versions of RoR

(Rbenv or RVM) and Bundler allow to isolate gems of different Rails applications. So there will be no troubles with that.

Each rails app will have its own instance of Unicorn(puma, thin, whatever).

Nginx will have separate domain name based virtual host for each rails app, and will forward requests to upstream(Unicorn/Puma).

Each rails app should have separate database at db server too.

So I don't see any problems with isolating multiple rails apps.

For additional isolation you can use Docker, so each app will be running in separate container.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM