Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Better healthcheck, add /_/ready
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulik committed Feb 12, 2023
1 parent 093302d commit d6d0f7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog

EXPOSE 8080
HEALTHCHECK --interval=2s CMD curl -f http://127.0.0.1:4567/healthcheck
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1


ENV fprocess="bundle exec falcon serve -b http://0.0.0.0 -p 4567 -n 1"
Expand Down
6 changes: 5 additions & 1 deletion base/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ get "/healthcheck" do
[200, {}, "ok"]
end

get "/_/ready" do
[200, {}, "ok"]
end

handler = lambda do
token = request.env["HTTP_AUTHORIZATION"] || params[:token]

Expand All @@ -27,7 +31,7 @@ handler = lambda do
body = begin
str = request.body.read
JSON.parse(str, symbolize_names: true)
rescue StandardError => e
rescue StandardError
nil
end

Expand Down

0 comments on commit d6d0f7e

Please sign in to comment.