Step 1: Provision Infrastructure
Estimated time of completion: 30 minutes
Step 2: Convert your Procfile
to porter.yaml
Estimated time of completion: 5 minutes
porter.yaml
file. While this is an optional step, porter.yaml
allows you to declare your
application in a similar way as you can on Heroku using a Procfile
.
Converting a Procfile
into a porter.yaml
file is straightforward. For example, a Procfile
that looks like this:
porter.yaml
file:
porter.yaml
. For a full guide on how to write a porter.yaml
file, take a look here.
Step 3: Launch Applications
Estimated time of completion: 10 minutes
porter.yaml
file is ready and is present in the root folder of your repository, you can simply link up your repository. Porter will detect your porter.yaml
file
and create your application accordingly. Porter supports Heroku’s own buildpacks, so your applications will be built the exact same way as you can on Heroku. If you are capable of it, however,
we recommend that you write a Dockerfile
for your application.
If you are using custom buildpacks, you will have to fork the custom buildpack you are using and make it compatible with Cloud Native Buildpacks.
Doing this is not arbitrary, and in most cases we recommend that you write a Dockerfile
for your application instead. If you are not able to write a Dockerfile
and are using any of the following custom buildpacks, we maintain a fork of these custom buildpacks that you can just plug into Build Settings from the dashboard.
libvips
- Installs thelibvips
library (https://github.com/portersupport/cnb-libvips)wkhtmltopdf
- Downloads and extracts thewkhtmltopdf
binaries (https://github.com/portersupport/heroku-buildpack-wkhtmltopdf-1)puppeteer
- Installs dependencies needed in order to run puppeteer (https://github.com/portersupport/cnb-puppeteer)ffmpeg
- Installsffmpeg
and its dependencies (https://github.com/portersupport/heroku-buildpack-ffmpeg-latest)apt-buildpack
- Installs dependencies declared in theAptfile
(https://github.com/portersupportapt-buildpack)geo-buildpack
- Installs GEOS libraries (https://github.com/portersupport/cn-buildpack-geo)
Dockerfile
instead if possible.
For a step by step guide on how to do this, please follow this guide.
Step 4: Copy over Environment Variables
Estimated time of completion: 5 minutes
printenv
from your Heroku console or the CLI:
printenv
will contain some variables that you did not add yourself.
You will need to remove some of these environment variables that are specific to Heroku. The important environment variable that’s essential to remove is the PATH
environment variable as this would
cause the build process to fail. With this copied set of environment variables, click on Deploy.
Step 5: Debugging your build process on GitHub Actions
Porter uses GitHub Actions to build your applications. To debug your application builds, take a look at your build logs from the Actions tab of your repository. To change your build settings or environment variables, simply edit it from the Porter dashboard. If you navigate to Build Settings, you’ll see a checkbox that says Re-run build and deploy on save. With that setting enabled, click on Save Build Settings to re-run the build.
Step 6: Allocate Resources
Once your application has built and you can verify that it’s running properly, next step is to rightsize your applications with an appropriate amount of RAM and CPU. Here’s the resource allocation that corresponds to each dyno type:- Standard 1X Dyno - 1000m vCPU, 500MB RAM
- Standard 2X Dyno - 1000m vCPU, 1GB RAM
- Performance-M Dyno - 1000m vCPU, 2.5GB RAM
- Performance-L Dyno - 2000m vCPU, 14GB RAM
Step 7: Switch over DNS
The final step is to switch over your production traffic by changing your DNS records. Follow this guide to add your custom domain to the application and create aCNAME
record in your DNS provider that points to the Load Balancer’s IP address as specified in the aformentioned docs. This switchover may incur downtime. In most cases, this switchover does not incur more than
5 minutes of downtime. We recommend doing this during your low-traffic hours.