I’m currently working on a Phoenix umbrella application which has two Phoenix applications “under the umbrella”. Each application is configured to listen on a different port:
my_application # -> Ecto and database stuff
my_appliaction_web # -> Frontend application listening on port 4000
my_application_api # -> API application listening on port 5000
As the time comes closer, where I have to deploy the application I wonder how/where to deploy this kind of application. All PaaS providers I have looked at just show examples of deploying a “simple” Phoenix application which just listens on one port. I know the approach of a “master proxy” which is often mentioned when deploying an umbrella application to Heroku, but I think this is not the way I prefer, because I’d like the API under the subdomain api.my_application.com and the frontend under the subdomain www.my_application.com.
Since I’m impressed by Nanobox, I’ve read their docs which describe a way to add additional routing through their boxfile.yml, but I can’t figure it out how to configure it correctly for my setup.
Do you have recommendations for other PaaS providers, which are able to run Phoenix umbrella applications? Configuration examples for e.g. AWS, Heroku etc. are also welcome.
I’m not sure if they allow more than one port open, but have you checked gigalexir? It is a PaaS specialised to elixir, also it advertises itself with “no connection limits”, whatever they mean with that.
I haven’t deployed an umbrella with multiple phoenix apps but on EC2 an umbrella with one phoenix app and nginx, following this tutorial - and adjusted for EC2, so I imagine something like this would work (crude version):