sergio

sergio

1 umbrella app, can I host different apps to different Heroku apps?

I’ve been trying for two days to get an Elixir umbrella app to work on Heroku with a proxy app on a single heroku application to no success. It seems like I’m hammering my head against a wall haha.

I was wondering if I have this umbrella app:

  • App
  • App (elixir)
  • AppWeb (phoenix)
  • AppMarketing (phoenix)

Can I deploy it to two different Heroku apps in such a way that AppWeb runs on one app, and AppMarketing runs on a different heroku app? While both can share the business rule library of App?

This umbrella application is in a single git repository by the way.

Appreciate any helps with this! As my last recourse I’ll just use a single monolith phoenix app with scoped routes, but I would hate to do that if I can avoid it.

Most Liked

orestis

orestis

Umbrella applications are code-design concepts - just an easy way to develop related applications together and share code etc.

What you want is to create two different releases:

Release A will run App + AppWeb
Release B will run App + AppMarketing

This will work if the App is a library application, i.e., just a bunch of functions without its own supervision tree. If however it starts its own tree, which for example is the case if it uses Ecto, you would be better placed to run it only once. You will need to add extra configuration to your apps to teach them how to find the other nodes, and deal with Heroku’s daily restarts, firewalls, internal networking and so on.

All that said, as you’ve found out, dealing with complicated releases and distributed Erlang/Elixir adds significant complexity in your Ops. Since you don’t need to change your code dramatically to do this split later on, it’s best to start by running everything on a single node.

nivanson

nivanson

I’ve been serving multiple apps with a custom endpoint proxying to the other endpoints. The other endpoints had server: false in their configuration. However I recently started using websockets and that’s where this setup fell short. Now I use a nginx proxy in front of the application. So still one application on heroku serving multiple applications with multiple endpoints.

https://github.com/heroku/heroku-buildpack-nginx

cblavier

cblavier

Hi @arjun289
I’m running an umbrella app with websockets on Heroku for over a year now, without any trouble

Here is my setup: Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly. · GitHub

Where Next?

Popular in Questions Top

beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
yawaramin
In the Dialyzer docs ( dialyzer — OTP 29.0.2 (dialyzer 6.0.1) ), there is a way to turn off a specific warning for a function: -dialyzer...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement