Deploying a Phoenix application with Appliku
This is a quick guide on how to deploy a Phoenix app with Appliku. You bring your own servers and everything’s setup with a Dockerfile.
Set up your Phoenix application
- Create a Phoenix app with
mix phx.new myapp. - Generate a Dockerfile by running
mix phx.gen.release --docker -
In the Dockerfile, comment out the final
CMDcommand that starts the server. You will add web and release processes later to replace them.... # CMD ["/app/bin/server"]
Set up Appliku
After you’ve created a server from Hetzner (or another provider), log in to Appliku and set up your server by adding its IP address and adding the public SSH key to your authorized keys file (~/.ssh/authorized_keys).
- Start by adding an application from your git provider and choosing the same server you just set up.
- For the base docker image, select
Dockerfile from the codebase. -
Add environment variables:
PHX_HOST: Appliku assigns a URL with a subdomain on*.applikuapp.comto this application, so find that value and update this variable.SECRET_KEY_BASE(runmix phx.gen.secretto generate one).- Other required environment variables are already set inside the Dockerfile.
-
Add these three processes:
release:/app/bin/migrateweb:/app/bin/server
-
Deploy!
- You should see your app on the default
myapp.applikuapp.comsubdomain.
- You should see your app on the default
This post contains affiliate links.