简体   繁体   中英

How to deploy elixir app from Windows dev machine to Ubuntu server

I've developed an app on Windows machine and I need to deploy it to Ubuntu 18.04 server. The tools I'd like to use are distillery and edeliver.

So can I just build the release with distillery on my Windows machine or should I build it on the machine with the same CPU architecture and Ubuntu 18.04 as the future production machine will be, for example create Virtualbox Ubuntu guest machine, share my app's project folder between Windows host machine and guest machine and build release on Ubuntu guest machine?

If someone develop elixir apps on Windows can you share steps of your deployment procedure?

Normally distillery packs everything you need to run your app and it's platform dependent. We do our builds in docker with image that matches production server architecture precisely, but it's also possible to use some dedicated build server.

However, if your app doesn't use any odd libraries that depend on binaries, I think (but I'm not sure) you might get away with just setting up runtime on server as you wish and just moving erlang bytecode compiled on Windows. But why would you want to do that?

I have attempted to help @PaulSchoenfelder with deploying Elixir apps built on Windows in the past. I don't believe I'm talking out of school to say we never had roaring success with this. We could get it to work but it always had some rough edges. Hence my answer to you would be build it (and run Distillery against it) on your Ubuntu target.


EDIT: I had forgotten that if you're on Windows 10 then WSL may be an option for you as well.

In general, the best way to deploy Erlang or Elixir is to use a release. A release will include the Erlang Runtime as well as all your config, beam files etc.

In theory, you can cross-compile a release but it is probably more trouble than it is worth. I generally just use a Virtual Machine via Vagrant

I have an email course about it here https://elixirtraining.us7.list-manage.com/subscribe?u=150de5dbc56d446a48f7fc3fd&id=03791ac7a9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM