Does anyone here deploy using Ansible, Haproxy on baremetal?

   aliases: aliases(),
      deps: deps(),
      releases: [
        razor_new: [
          steps: [:assemble, :tar]
        ]
      ]
    ]

add this section to def project do in mix.exs.

read more about releases here.


Rsync to the server is simple.


Adding to systemd

[Unit]
Description=razor_new service
After=local-fs.target network.target postgresql.service

[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/home/ubuntu/deploy/
ExecStart=/home/ubuntu/deploy/bin/server start
ExecStop=/home/ubuntu/deploy/bin/server stop
EnvironmentFile=/home/ubuntu/.env.prod
Environment=LANG=en_US.utf8
Environment=MIX_ENV=prod


Environment=PORT=4000
LimitNOFILE=65535
UMask=0027
SyslogIdentifier=razor_new
Restart=always


[Install]
WantedBy=multi-user.target

Tweak this one as you like. This helps start the service and run in background. That’s what I use systemd for.


At the moment, my nginx is bloated with lots of ports and services it is serving as a frontend to.

However, i will post the blogs I used to configure it initially for elixir.

1 Like