2
votes

I've created Elixir application (Slack bot) which I would like to deploy to my friend's server running Ubuntu. What's the best way to do this without having to build the application on his machine?

I tried using exrm to create a package to be deployed, but since I'm developing on Windows the package is suitable only for Windows machines (erts-7.2.1/bin dir contains only Windows binaries).

I don't need very advanced deployments so maybe I could just copy the compiled app and run it there. But I don't know what should I copy (beam files?), from where and how to run it afterwards.

Another problem is that there's no Erlang/Elixir on the server, but there's docker so I can use one of the images. Which one should I use - Erlang or Elixir image?

The app itself uses the Application behaviour (use Application) which starts the main supervisor.

1

1 Answers

1
votes

Preface: If you can I would ask your friend if you can have elixir/erlang installed on the machine. You can go the docker route but as far as I know it means you can't do 'hot upgrades'.

The easiest way I have found to deploy an application to a server running ubuntu is to use Edeliver. Essentially, once you set it up, deploying is as simple as:

mix edeliver build release 
mix edeliver deploy release to production
mix edeliver restart production

Checkout the readme - it goes through the whole process very clearly.