Elixir applications in Docker containers?

Found it, if you disable the SSL option for the repo in config/prod.exs, it works fine.

I guess it’s a safe option as both the app and the database live within the Flynn cluster.

1 Like

Then I think they have rolling deploys with no downtime?

Yes, probably, but hot-code-reloading is state-aware, rolling deploys only if you persist your state on disk. Its like starting up a new machine and reconstructing necessary state from the environment and persistet data.

There are other options for state-preserving rolling deploys. At the last ElixirConf, I did a demo of a rolling deploy while preserving (i.e. migrating) a dynamic set of processes along with their state. It uses a distributed Supervisor and a CRDT—no disk or database persistence needed, and it works well enough for an interactive game application. In general, these are just technical problems for us to solve, and I think there are still creative solutions out there.

3 Likes

Since this thread is still getting traffic I thought I’d add that it is no longer the case that you need anything special (like some distillery script that bitwalker mentions) for Erlang to stop gracefully with init:stop() when a SIGINT is sent to the process like Kubernetes does.

I think it was 20 that this got added.

And there is an issue of schedulers that I’d like to see solved. You can set the number of online schedulers while Erlang is running, but there isn’t, as far as I know, anything that will automatically update this if the underlying cpu resource allocated by like kubernetes is changed.

2 Likes

I wonder if you can share your Dockfile and K8s setup with us? is that open source?

1 Like