Looking for any tutorial or docs for deploying phoenix app to dedicated server

Hi I am considering to deploy my app(currently running in third party service) to dedicated server.
I just looked up this forum and read some posts and made up my mind to try to deploy to dedicated server
But It is hard to find any step by step tutorial for that method. So please help me!

I found this.

And have some questions

  1. How do you keep the backed up database? keep it separate from server? like in AWS S3?
  2. Do you do cron job for backup database?
  3. Do you usually run 2 dedicated servers in case of 1 server goes down?
  4. How do you monitor server stats? using Webmin?
  5. How do you log your app?

And what else should i consider?

Piling on here - I’m curious if anyone can describe the best way to create a debian package from an elixir release. I’d like to distribute the deb file then dpkg -i <app>.deb

I maintain 2 servers:

  1. Heavy duty production server
  2. A smaller one for everything else. This hosts a bunch of websites and also acts as a backup server.

Then I have these 2 cronjobs in the production server:

0 * * * * /bin/bash -l -c '/usr/bin/pg_dump -U postgres jt_production -Fc -f /var/jt/pgdump/jtdb-$(date -d "today" +"\%Y-\%m-\%d-\%H-\%M").sql'

0 0 1,8,15,22 * * /bin/bash -l -c 'tar czvf /var/jt/pgdump/jtdb-wkl-arch-$(date -d "today" +"\%Y-\%m-\%d").tgz /var/jt/pgdump/jtdb-*.sql && rm /var/jt/pgdump/jtdb-*.sql'

First job pgdumps the production db at midnight. The second job picks up .sql files from the first cronjob and creates a .tgz and removes all the .sql files every week (specifically on these days: 1,8,15,22). Otherwise these sql files fill up the server very fast.

I have another cronjob in server#2 that just scp’s data from server#1.

I am thinking about replacing this system with tarsnap very soon.

1 Like