2

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.

Maciej Wozniak
  • 1,174
  • 15
  • 27

1 Answers1

0

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.

Harrison Lucas
  • 2,829
  • 19
  • 25
  • Thanks, will check that out. But from what I've seen on edeliver page it needs to build the release on a system similar to the target one (so Linux in that case). I was hoping I could build locally on Windows and just send the compiled app since it runs on Erlang VM anyway. – Maciej Wozniak Jul 07 '16 at 15:05
  • 1
    @MaciejWozniak The way I overcame this issue was to literally just build on the target server. So i'd build on the server as well as deploy to the server – Harrison Lucas Jul 07 '16 at 23:00