🚀 Deploying Permit.io PDP to Heroku
Let’s deploy your Permit.io Policy Decision Point (PDP) to Heroku — the easy way. Follow along!
✅ Prerequisites
Before we get started, make sure you have the following:
- 🧾 A Heroku account — I'm using the free tier via GitHub Student Pack. Thanks GitHub! 🙌. Make sure you create an app that is the target of your deployment.
- 🛠️ Installed Heroku CLI
- 🚫 No need for Docker Desktop installed locally
- 🐶 A Permit.io account
- 🧑💻 Git installed
🛠️ Setup
- Create a working directory
-
Ensure Heroku CLI is installed:
heroku -v
-
Login to Heroku:
heroku login
-
Authenticate with the Heroku Container Registry:
heroku container:login
Make sure you’ve created an app on Heroku
-
Set environment variables:
heroku config:set PDP_API_KEY=
-a your-app-name heroku config:set PDP_DEBUG=True -a your-app-name -
Set your app to use the container stack:
heroku stack:set container
⚙️ Configuration File
1. Create a Dockerfile
Inside your directory, create a Dockerfile
:
# ./created-directory/Dockerfile
FROM permitio/pdp-v2:latest
CMD uvicorn horizon.main:app --host 0.0.0.0 --port $PORT
This ensures Permit PDP uses the correct port that Heroku assigns dynamically.
2. Create a heroku.yml
File
This tells Heroku how to build and deploy your Docker container:
# ./created-directory/heroku.yml
build:
docker:
web: Dockerfile
🚢 Deployment
-
Initialize a Git repository:
git init git add . git commit -m "Initialize Heroku config"
-
Connect your repo to Heroku:
heroku git:remote -a yourapp
-
Push to Heroku to build and deploy:
git push heroku master
-
Open your app in the browser:
heroku open
🎉 Success!
You should see this response:
{"status":"ok","online":true}
Your Permit.io PDP is now live on Heroku! 🔥