πŸ“˜

Prerequisites:

  • You have an existing Aptible account and project
  • You have installed the Aptible CLI and are logged in to the CLI via aptible login.

Deploying Porter on Aptible

Deploying Porter on Aptible will require either an existing PostgreSQL instance, or will require you to create one first (see below). You should have the database authentication credentials handy for the deployment step.

Create and deploy an instance of Porter with no config set:

aptible apps:create porter
aptible deploy --docker-image=porter1/porter:v0.3.3 --app porter

Then, set config to deploy Porter:

aptible config:set --app porter \
  SERVER_URL=https://<your-porter-endpoint> \
  REDIS_ENABLED=false \
  ENCRYPTION_KEY=$(cat /dev/urandom | base64 | head -c 32) \
  COOKIE_SECRETS="$(cat /dev/urandom | base64 | head -c 16);$(cat /dev/urandom | base64 | head -c 16)" \
  SQL_LITE=false \
  DB_HOST=<postgres-host> \
  DB_PORT=<postgres-port> \
  DB_USER=<postgres-user> \
  DB_PASS=<postgres-password> \
  DB_NAME=porter \
  DB_FORCE_SSL=true \
  FORCE_SSL=true \
  HELM_APP_REPO_URL=https://charts.getporter.dev \
  HELM_ADD_ON_REPO_URL=https://chart-addons.getporter.dev

πŸ“˜

Note: if you are using an Aptible default domain *.on-aptible.com, you may have to deploy Porter without the SERVER_URL variable set, and then run aptible config:set again after you set up the endpoint in Aptible. You can do this by only adding SERVER_URL in aptible config:set on subsequent deployments:

aptible config:set --app porter SERVER_URL=https://<subdomain>.on-aptible.com

(Optional) Creating a PostgreSQL instance on Aptible

Create the database via the following command:

aptible db:create postgres --type postgresql

Then, go to your Aptible dashboard to view the deployed database credentials. These can be found by clicking on the "Reveal" button for the database credentials:

This will display a connection string to the PostgreSQL instance. The following shows the environment variables that these map to when running aptible config:set above:

postgresql://DB_USER:[email protected]_HOST:DB_PORT/DB_NAME