How to deploy multiple elixir app and phoenix app to heroku

I have multiple apps in my directory that has to be deployed.
like App A, B, C and D as phoenix app
And app has dependency on other app in mix.exs like this {:app_A, [path: "…/app_A]}
how can I deploy all this together in heroku?
I read a document deploying to heroku. But it tells me that deploying just a one phoenix app.

As on heroku you only have a single address and port, how would you be able to dispatch an incomming request to the app?

The only way I see is to deploy them as distinct applications each, this will not be possible though if you have remote calls between the apps, what you probably have if you say you have them specified as dependencies of each other.

So, whats left is searching for another hosting opportunity, gigalixir is the quasi standard in the elixir world and replaces heroku, as it follows the same concepts but droped some limitations that are unsuitable for BEAM applications (forced node down, one port limitation, etc).

I’m still not sure if you can multiple phoenixes properly there.

2 Likes

If there’s only one web accessable app it should work on heroku. You need to either make sure all apps are in the git repo heroku uses or you can use the docker deployment for heroku.

Oh So you tell me that I can deploy phoenix app to heroku(since I have only 1 phoenix app)
then phoenix app can have dependencies that fetch from github.
RIght?

Dependencies can also be in the same repo as the phoenix app to be deployed to heroku. There should be no need to install them from github.

Oh, sorry, I read your initial post wrong then, I read it as A, B, C, D beeing all phoenix applications.

As you only have one application beeing actually phoenix, it should be doable to follow one of those millions of tutorials that explain how to deploy umbrella applications to heroku.

Under the hood umbrellas are just sugar for file dependencies…

Did you also check this guide for heroku deployment?

If you would to see an example of an umbrella application deployed to Heroku using buildpack, you can take a look at our community website: https://github.com/montrealelixir/website.

Thank you all guys.
I will try!

Can you explain more about this?
I don’t get it

I cannot find tutorials that explain how to deploy umbrella applications to heroku.
I found only this…https://hackernoon.com/deploying-a-phoenix-1-3-umbrella-app-to-heroku-452436b2b37f
but it won’t help me that much.

Heroku works by putting the files of a git repo in a box (can be configured if needed) and running commands you supplied on it like buildpacks and when the box is enabled it uses your runtime command to start the service. So you can have multiple mix projects in your repo and use {:my_dep, path: "../my-dep"} dependencies in the mix.exs. The limitation you do have is that heroku only allows one port to be accessable, so multiple phoenix apps are not that reasonable.

1 Like