Skip to content

Commit

Permalink
Add fly health check
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Nov 12, 2023
1 parent 0ed6a00 commit b69e75a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/fly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:

- uses: superfly/flyctl-actions/setup-flyctl@master

- run: flyctl deploy --remote-only -e GIT_SHA="${{ github.sha }}" -e APP_REVISION="${{ github.sha }}" -e GIT_MESSAGE="${{ github.event.head_commit.message }}"
- run: flyctl deploy --remote-only -e APP_REVISION="${{ github.sha }}"
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ RUN bundle exec bootsnap precompile app/ lib/
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile


# Final stage for app image
FROM base

Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@

match "/404", to: "errors#not_found", via: :all
match "/500", to: "errors#internal_server_error", via: :all
get "up" => "rails/health#show", :as => :rails_health_check
end
10 changes: 10 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ console_command = "/rails/bin/rails console"
force_https = true
auto_stop_machines = false
processes = ["app"]

[checks]
[checks.rails]
grace_period = "30s"
interval = "15s"
method = "get"
path = "/up"
port = 3000
timeout = "10s"
type = "http"

0 comments on commit b69e75a

Please sign in to comment.