is there any up to date resource out there (blog, talk, video, book…) about deploying elixir applications using releases?
In particular, I am interested in Phoenix apps.
I am looking for something that does not use a manged solution.
I am looking for something that does not use Docker.
Run mix release, open the release folder and find the binary to start your application. The code, runtime and configurations are all packed with the release.
Usually docker is used because that’s the simplest way to make sure the architecture between an external build machine and machines used to run the release are the same. If you can have the build machine match without using docker that works just as much.
I am building the release on the target directly (I use Ansible to automate).
It worked the first time with just a couple of env variables, that’s really amazing.
Yeah that works. Not a common solution though as you need build tooling on that server and you also have the load of doing the build there. Both things people tend to avoid in production.
There’s Deployment Archives - StakNine but the latest is 2022. He produced a book at Phoenix Deployment Handbook. There’s also Deploying Elixir - Miguel Cobá with his companion at Deploying Elixir eBook. Both are great resources and I’ve seen some other tutorials for Digital Ocean or running Elixir processes with supervisord. There’s also a library that helps create the scripts for that like mix release but it’ll take me a while to find that in my sea of GitHub stars.
Hi Carlo. Ansible is the way I went in combination with droplets on Digital Ocean. I found some excellent articles on the Cogini blog when it was starting out like yourself trying to figure out an approach. It takes some work but if you are down for it the work can be pretty rewarding. I wrote my own scripts using the information on Coflgini as a reference. I did not want to use theirs as is because it felt like I would be putting someone else in charge of my Devops and I needed to know how everything works under the hood in case issues arise. Hopefully it helps.
Mostly positive though for a long time I continued to self host our databases. I’d still prefer if they had a fully managed Postgres solution but what is there is generally good enough.
They’ve definitely had some growing issues over the last year though I’ve been lucky to avoid most of them causing us outages but I know for many other people that haven’t been so lucky there has been quite a bit of downtime.
Support definitely needs an improvement though we pay for email support and often my emails about outages won’t be responded to until like a day later.
My servers are all FreeBSD hosts. So I use FreeBSD jails.
I automate everything with gitlab pipelines.
So at the end, I make a merge request. Tag it with a version. Then the pipeline tests and builds the code with mix release, deploys it, creates a completely new jail with the release and fires its up.
All I have to do is, merge the request, tag it and done.
I will write something about it as soon as I have the time.
Please, write an article about your process. I’ve been learning FreeBSD for some time and would like to see real world usage, related to Elixir, because I plan on using the OS on my servers.
Currently, I’m able to build a service on the FreeBSD host, using releases, and then restart the system service.
The problem is I’m not there yet and I don’t want to jump on orchestration before knowing my way around the OS. Yes, I can manage jails, but not VNET. I want to be able to set up and shape a network as I want, with no surprises afterwards. I’m the type of person who wants to know the fundamentals first.