Elixir Deployment Options

One possibility is to just point both of those subdomains at your gigalixir app. You’d run something like

gigalixir add_domain myapp api.myapp.com
gigalixir add_domain myapp frontend.myapp.com

Then update the DNS records for both subdomains. More details on setting up a custom domain here:
http://gigalixir.readthedocs.io/en/latest/main.html#how-to-set-up-a-custom-domain

That should work, but it also might mean that frontend.myapp.com will respond to api requests unless you block it yourself.

We’re currently looking into implementing a way for a single umbrella app to listen on multiple ports. Not sure when that’ll be available though or what it’ll look like.

2 Likes

I prefer to use full-access VPS’s as opposed to things like Gigalixir/Nanobox/Heroku or any of those services. The reason is that even though there’s a lot more setup involved initially, once you have your app setup for deployment it’s usually pretty easy and quick from there on out.

Doing it in this way allows you to easily move from one provider to another if needed. Otherwise, you would have to extract certain deployment fragments from your Gigalixir/Heroku/other service configuration and then set the rest up manually anyway.

Also, I want the fine grained control over each component of my app, while still being able to run multiple apps on the same server, which most of those services don’t give you.

I personally use DigitalOcean as my provider and I use a $20/mo VPS. DO recently changed their pricing to match Linode/Vultr and the other guys so DO’s pricing is actually the same now where it lagged behind before.

I deploy my apps inside Docker only, so that everything is modular and I can add/remove/swap out different components of different apps at will, which is important to me since I have many apps to run on the same server.

If you want to see the comprehensive guide on how I setup my deployments, you can check it out on my forum thread.

P.S. Nothing against Gigalixir at all, they have a wonderful service and it makes everything way easier if you know you don’t need portability later, but this doesn’t really fit my use case, and I like using raw servers personally. Also, jesse is an awesome guy and I see him all over the place in relation to Elixir things so with Gigalixir you are in really good hands.

7 Likes

If you only have a few apps that aren’t being used 24/7 Heroku is often free. (I.e. you don’t need to pay for extra hours).

Another Heroku-like with support for Elixir: https://www.nodechef.com/blog/post/deploy-elixir-phoenix-apps-on-nodechef

2 Likes

Heroku doesn’t support certain features in Elixir which I think prevents the language from doing many of the things that set it apart from other languages, to be more specific https://hexdocs.pm/phoenix/heroku.html states that: Connections are limited, Distributed clustering is not possible, In-memory state such as those in Agents, GenServers, and ETS will be lost every 24 hours, and lastly Remote shells and remote observer are not possible. Because of these things I personally would prefer running my own nodes.

Most Elixir applications won’t get to the point multiple servers are needed and can be load balanced across a few very nodes. DigitalOcean has a 32 CPU Server with 64 GB of RAM one or two of those behind a load balancer should be more than enough for even the most demanding of applications.

Aiven looks good to.

Aiven PostgreSQL

Aiven PostgreSQL combines the best open-source SQL database with global coverage on Google Cloud Platform, Amazon Web Services, Microsoft Azure, DigitalOcean, and UpCloud to provide fully-hosted and managed PostgreSQL solutions.

The way I describe Heroku for Elixir is simply, just because Elixir has a feature doesn’t mean you have to use the feature. Basically the simple web app use case where the in memory stuff is really just caching and you can use the Redis adapter for channels.

Eventually, people will outgrow it but it’s pretty good for people just starting out. My blog still runs on the $7 hobby dyno with the free shared database and its survived a couple of hacker news front pages.

3 Likes

Found this through a Google search, did this ever get implemented on Gigalixir?

Note, I did find this: https://github.com/jesseshieh/master_proxy
Which implies that this is the proposed solution.