Skip to main content

Deploying Paybill on Google Cloud Run

info

You should setup a PostgreSQL database manually to be used by Paybill.

Follow the steps below to deploy Paybill on Cloud run with gcloud CLI.

Deploying Paybill application​

  1. Create a new Google Cloud Run Service:
Google Cloud Run New Setup
  1. Ingress and Authentication can be set as shown below, to begin with. Feel free to change the security configurations as per you see fit.
ingress-auth
  1. Under containers tab, please make sure the port is set to 3000 and command pnpm, start:prod is entered in container argument field with CPU capacity set to 2GiB:
port-and-capacity-paybill
  • If the command mentioned above is not compatible, please use the following command structure instead:
port-and-capacity-paybill-alternative-command
  • Should you encounter any migration issues, please execute the following command. Be aware that executing this command may cause the revision to break. However, modifying the command back to pnpm, start:prod will successfully reboot the instance:
port-and-capacity-paybill-migration-fix-command
  1. Under environmental variable please add the below Paybill application variables. You can also refer env variable here.

Update PAYBILL_HOST environment variable if you want to use the default url assigned with Cloud run after the initial deploy.

env-variable-paybill
tip

If you are using Public IP for Cloud SQL, then database host connection (value for PG_HOST) needs to be set using unix socket format, /cloudsql/<CLOUD_SQL_CONNECTION_NAME>.

  1. Please go to the connection tab. Under Cloud SQL instance please select the PostgreSQL database which you have set-up.
cloud-SQL-paybill

Click on deploy once the above parameters are set.

info

Once the Service is created and live, to make the Cloud Service URL public. Please follow the steps here to make the service public.

Upgrading to the Latest LTS Version​

New LTS versions are released every 3-5 months with an end-of-life of atleast 18 months. To check the latest LTS version, visit the Paybill Docker Hub page. The LTS tags follow a naming convention with the prefix LTS- followed by the version number, for example paybilldev/paybill:ee-lts-latest.

If this is a new installation of the application, you may start directly with the latest version. This guide is not required for new installations.

Prerequisites for Upgrading to the Latest LTS Version:​

  • It is crucial to perform a comprehensive backup of your database before starting the upgrade process to prevent data loss.

If you have any questions feel free to join our Discord Community or send us an email at info@paybill.dev.