Up to this point I’ve been using edeliver. Now I want to build and release an app via mix.
If I build a release on a local computer:
MIX_ENV=prod mix release --overwrite
and then simply copy this file
to a remote server and launch:
will everything work as intended?
Provided that the environment on a server has been set up.
Also, I’m on Mac and will build a release on it. Will it work on a Linux server?
No, you have to use exactly the same environment.
After creating the release you’ll have the following folder
Then you have to copy all the files and folders under
to your remote server.
To create a release I copy my source files to a build server which has erlang, elixir, and nodejs installed. This build server is actually a virtual machine in VirtualBox in my development computer.
Then I generate the release on the build server and finally copy the release to the production server.
The production server does not need to have erlang, elixir or nodejs installed since the release contains all the necessary files to run your app.
Can OS-es on a built server and production one differ? MacOS <-> Linux, or MacOS <-> FreeBsd
Only if you don’t include erts in the release and install the exact same version of erlang on the production system. And NIFs need to be taken care of. Generally it’s easier to setup docker or some over vm to mimic production then trying to align production with another OS on the build server.