π«Deployment
How to get your app running in production
Before deploy
Before deployment, we've found an issue in production with the new content security policy headers. Basically, you need to add wss://...
and your domain to the :content_security_policy
default_src
array, like below.
Read more:
Removing CSP
If you don't care about content security policies, you can remove this config and then in router.exs
change:
Faker dependency and the Landing Page
If you haven't changed the landing page yet, there will be references to Faker. If you don't remove references to Faker, you'll need to find this line in mix.exs
:
And change it to this:
A word on environment variables
In production, Petal Pro requires the following environment variables to be set:
SECRET_KEY_BASE
DATABASE_URL
PHX_HOST
PORT
If you're deploying to Fly.io, these environment variables should be automatically taken care of. However, if you're testing prod
on your dev machine or using a different deployment mechanism - you'll need to make sure that these environment variables have been set.
Please bare in mind that SECRET_KEY_BASE
and DATABASE_URL
are secrets and need to be protected. Please follow best practices for managing secrets on the platform you are deploying to.
Deployment with Fly.io
To deploy to Fly.io, use the following guide:
Last updated