diff --git a/apps/api/src/app/health/health.controller.ts b/apps/api/src/app/health/health.controller.ts index 5542ae933..a76a36656 100644 --- a/apps/api/src/app/health/health.controller.ts +++ b/apps/api/src/app/health/health.controller.ts @@ -23,6 +23,12 @@ import { HealthService } from './health.service'; export class HealthController { public constructor(private readonly healthService: HealthService) {} + /** Liveness: returns 200 as soon as the server is listening (for Railway etc.) */ + @Get('live') + public getLive(@Res() response: Response) { + return response.status(HttpStatus.OK).json({ status: 'OK' }); + } + @Get() public async getHealth(@Res() response: Response) { const databaseServiceHealthy = await this.healthService.isDatabaseHealthy(); diff --git a/railway.toml b/railway.toml index 9f38ae6df..fe501cbee 100644 --- a/railway.toml +++ b/railway.toml @@ -4,6 +4,7 @@ builder = "DOCKERFILE" dockerfilePath = "Dockerfile" [deploy] -# Healthcheck disabled so deploy can succeed; fix DB/Redis env if app doesn't respond +healthcheckPath = "/api/v1/health/live" +healthcheckTimeout = 300 restartPolicyType = "ON_FAILURE" restartPolicyMaxRetries = 10