Answer the question
In order to leave comments, you need to log in
How to deploy Elixir/Phoenix application on VPS?
Everything I did to deploy my Elixir/Phoenix app didn't work at all. Either one or the other. There are always some errors, for example, in npm, you have to disable something, delete something. And this is not the first time and not only with npm. But there is no proper guidance anywhere. Firstly, they quickly become outdated, and secondly, they are not detailed, some points are omitted from them. And yet, they are all different, different tools are used completely and everywhere, you won’t understand which of them are recommended and which are not.
I only managed to deploy it once, on heroku, but there are really several commands, there is nowhere to make a mistake. And I need it on my server.
How do I deploy it in general, do I need to install elixir on the server? Necessarily? Or is it possible to compile it locally and upload what happened to the server? Or it is necessary to compile on the server? I understand that these are 2 different approaches. How is it better?
Please tell me how to do it anyway.
Answer the question
In order to leave comments, you need to log in
I literally just deployed the application, I had to suffer a little, but nothing extraordinary in the end.
Perhaps this is not quite the right option, or maybe not at all the right one, but I'll figure it out later.
Stages:
- put on vps erlang and elixir;
wget https://packages.erlang-solutions.com/erlang-solut...
dpkg -i erlang-solutions_1.0_all.deb
apt-get update
apt-get install esl-erlang
apt-get install esl-erlang
apt-get install elixir
- added a production config to the project, config/prod.ex, don't forget about prod.secret.ex;
blog.plataformatec.com.br/2016/05/how-to-config-en...
- also added a module for migrationsblog.plataformatec.com.br/2016/04/running-migratio... I
made a release on the vps itself, since the poppy itself, and on the debian vps, there were errors with the launch due to problems with cross-compile.
The release was prepared like this:
- git clone ..
- mix deps.get
- npm install -g brunch
- brunch build --production && MIX_ENV=prod mix phoenix.digest
- MIX_ENV=prod mix compile
- MIX_ENV=prod mix release
- rel/elixirjob /bin/elixirjob console (for verification)
- rel/elixirjob/bin/elixirjob command Elixirjob.Release.Tasks migrate
As a result, we go to vps_ip:PORT and see the running application.
Found another option, but haven't tried it yet
blog.plataformatec.com.br/2016/06/deploying-elixir...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question