Deployment
How to get your app running in production
Was this helpful?
How to get your app running in production
Was this helpful?
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:
If you don't care about content security policies, you can remove this config and then in router.exs
change:
And change it to this:
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.
To deploy to Fly.io, use the following guide:
If you haven't changed the landing page yet, there will be references to . If you don't remove references to Faker, you'll need to find this line in mix.exs
: