# Hosting other Ruby on Rails App Side by Side with Discourse

**URL:** <https://meta.discourse.org/t/hosting-other-ruby-on-rails-app-side-by-side-with-discourse/17610>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [15.Июль.2014 15:49:27 UTC](https://meta.discourse.org/t/hosting-other-ruby-on-rails-app-side-by-side-with-discourse/17610 "2014-07-15T15:49:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)\
**Post date:** [15.Июль.2014 17:28:30 UTC](https://meta.discourse.org/t/hosting-other-ruby-on-rails-app-side-by-side-with-discourse/17610/3 "2014-07-15T17:28:30Z")

</div>

Hm, this is a difficult topic to write about, because it touches many different aspects of Linux server administration and maintenance. I tried to type up a “quick overview” but realized it’d either turn into a freaking **book** or be full of holes and pitfalls and "you’ll figure it out"s.

So… on an even more abstract level, this is what you’d probably want to do:

- Set up Redis, PostgreSQL and Nginx on your host.
- Use the `web_only.yml` sample instead of `standalone.yml`.
- Hack the `web.template.yml` or use a hook in your `app.yml` so that nginx isn’t started inside the container.
- Wire it all together so that Discourse connects to Postgres and Redis on your host and the host forwards requests to the Unicorn running inside the container.

The most important thing to keep in mind is that “inside the container” and “outside the container” might, for these purposes, as well be two different computers. Most importantly, **THE CONTAINER’S LOCALHOST AND THE HOST’S LOCALHOST (127.0.0.1) ARE SEPARATE NETWORK DEVICES!** If Unicorn-inside-the-container is set to bind to 127.0.0.1:3000, then nginx-in-the-host _will not be able to connect to it_. Instead, refer to [the Docker Advanced networking documentation](https://docs.docker.com/articles/networking/); your goal is make Docker assign a predictable IP address to the Discourse container and have Nginx forward requests there.

---

_[View the full topic](https://meta.discourse.org/t/hosting-other-ruby-on-rails-app-side-by-side-with-discourse/17610)._
