Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix healtcheck fail when TELEGRAM_STAT is not set #50

Merged
merged 2 commits into from
Jan 23, 2021

Conversation

giuseppeM99
Copy link
Collaborator

This should close #30
plus this removes curl from the dependencies

@giuseppeM99 giuseppeM99 added the bug Something isn't working label Jan 21, 2021
@luckydonald luckydonald self-requested a review January 21, 2021 23:33
Copy link
Collaborator

@luckydonald luckydonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can get rid of || exit 1 for now.

Dockerfile Outdated
@@ -30,6 +30,6 @@ RUN addgroup -g 101 -S telegram-bot-api \
&& chmod 700 ${TELEGRAM_TEMP_DIR}
USER telegram-bot-api:telegram-bot-api

HEALTHCHECK CMD curl -f http://localhost:8082/ || exit 1
HEALTHCHECK CMD nc -z localhost 8081 || exit 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the || exit 1 part needed? nc already returns a status code.

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you test it without exit 1? if that works i'll remove it [cc @MarcoBuster]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giuseppeM99, @luckydonald is right.

marco@acer-pop:~$ nc 127.0.0.1 12345
marco@acer-pop:~$ echo $? 
1

@luckydonald
Copy link
Collaborator

luckydonald commented Jan 22, 2021

I tested the netcat command like that, and it works.
Tested on a Mac, but is linux-y enough usually.

Copy link
Collaborator

@luckydonald luckydonald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarcoBuster MarcoBuster merged commit cb51c3e into tdlight-team:master Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails if TELEGRAM_STAT is not set
3 participants