Easy deployment for your Elixir/Phoenix application

2017-03-23 17:19
2017-03-23 17:19

Guten Tag!

If you're a Ruby/Rails programmer and you're trying Elixir/Phoenix, probably you would have this question "Is there a way to deploy my phoenix application such as Capistrano?".

As far as I've checked, there is no tool like Capistrano for phoenix. So I've tried 2 ways. First one is deployment by docker. This looks good and really modern way. However, to do this, it needs too much works, I thought. Second one is what I want to recommend here. It's a deployment by ansible. If you have some experiences to use ansible, it's quite easy. Even if not, it's not difficult and easy to understand.

Fortunately, there is a library called Ansistrano which is for ansible.

Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style

Sounds good, doesn't it? :) Of course, we can use this for our phoenix application as well.

I just adapted phoenix deployment process to this library.
This is the repository.



Set your environment
Please grep 'TODO', then replace with proper text fits your environment.

Prepare New Server

$ ansible-playbook -i production centos.yml -u root

Deploy app

$ ansible-playbook -i production deploy.yml -u deploy


You can clone and use it for your application.

Hope this would be helpful for you.