Skip to content

Commit 196a83c

Browse files
committed
fix: adjust railway toml and json for healthcheck
1 parent 9e2f438 commit 196a83c

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

app/controllers/health_controller.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# frozen_string_literal: true
22

33
class HealthController < ActionController::API
4+
# Skip authentication and authorization for health checks
5+
skip_before_action :verify_authenticity_token, raise: false
6+
47
# Simple health check that doesn't check database
58
def index
69
render json: {
710
status: 'ok',
811
timestamp: Time.current.iso8601,
9-
environment: Rails.env
10-
}
12+
environment: Rails.env,
13+
service: 'ProStaff API'
14+
}, status: :ok
1115
end
1216

1317
# Detailed health check with database verification
@@ -18,6 +22,7 @@ def show
1822
status: database_status ? 'ok' : 'degraded',
1923
timestamp: Time.current.iso8601,
2024
environment: Rails.env,
25+
service: 'ProStaff API',
2126
database: database_status ? 'connected' : 'disconnected'
2227
}, status: database_status ? :ok : :service_unavailable
2328
end

railway.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Railway Configuration for ProStaff API (Rails)
2+
[build]
3+
builder = "dockerfile"
4+
dockerfilePath = "Dockerfile.production"
5+
6+
[deploy]
7+
startCommand = "bundle exec puma -C config/puma.rb"
8+
healthcheckPath = "/health"
9+
healthcheckTimeout = 300
10+
restartPolicyType = "on_failure"
11+
restartPolicyMaxRetries = 3

0 commit comments

Comments
 (0)