Files
coco 723ce1af5c a
2026-07-03 15:12:48 +08:00

1.9 KiB

Deployment on Railway.app

This project is currently deployed on Railway.app on the following URL

Deployment on Railway is very simple. On every push, it automatically deploys project.

Railway.app Dashboard - NotyKT

Deployment Pre-requisites

Create bundle on Build

Whenever deployment is triggered, it executes Gradle task - build which will be responsible for project build generation and then deployment. So make sure to generate artifact on build command itself.

build.finalizedBy(installDist)

Or use below code if you're using Gradle Kotlin DSL

tasks.getByName("build").finalizedBy("installDist")

Create Procfile

You will also need a Procfile describing what to execute at the time of deployment.

As we set up Gradle task in previous step, whenever Gradle task stage is executed, built application artifacts are generated at the path application/build/install/application/bin/application. In the Procfile, just provide the name of the process and the generated executable file.

web: application/build/install/application/bin/application

Configure project on Railway.app

  • Create a project on Railway.app (from GitHub).
  • Configure deployment branch as master and directory noty-api (as API source is in directory).
  • Add PostgreSQL Database service in Railway.app. Steps below
  • Configure environment variables (as seen in the above image, you'll need to create DATABASE_DRIVER, DATABASE_MAX_POOL_SIZE and SECRET_KEY environment variables, rest will be created by railway once you add postgres).
  • After this, just deploy and check whether everything is working fine.