Skip to content

Docker healthcheck#7945

Merged
Alkarex merged 5 commits intoFreshRSS:edgefrom
Alkarex:docker-health
Sep 11, 2025
Merged

Docker healthcheck#7945
Alkarex merged 5 commits intoFreshRSS:edgefrom
Alkarex:docker-health

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Sep 10, 2025

fix #7377

@Alkarex Alkarex added the Docker 🐋 Everything related to Docker label Sep 10, 2025
@Alkarex Alkarex added this to the 1.27.1 milestone Sep 10, 2025
Comment on lines +26 to +33
# # Optional healthcheck section:
# healthcheck:
# test: ["CMD", "cli/health.php"]
# timeout: 10s
# start_period: 60s
# start_interval: 11s
# interval: 75s
# retries: 3
Copy link

@schildbach schildbach Sep 10, 2025

Choose a reason for hiding this comment

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

I'd indent this by one more space, because if you remove the # the YAML format will be invalid.

Choose a reason for hiding this comment

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

Or actually I think one space needs to be removed on each of the lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks good to me.

Using automatic Toggle line comment from an IDE such as VSCode produces the following result (and it works as well in the other direction):

    environment:
      TZ: Europe/Paris
      CRON_MIN: '3,33'
      TRUSTED_PROXY: 172.16.0.1/12 192.168.0.1/16
    # Optional healthcheck section:
    healthcheck:
      test: ["CMD", "cli/health.php"]
      timeout: 10s
      start_period: 60s
      start_interval: 11s
      interval: 75s
      retries: 3

Did you try in an IDE (and in that case which one?) or did you uncomment manually line by line?

Note that the convention for this type of comment is the comment sign itself followed by a space, as hinted in the first line # # Optional healthcheck section:

Side note: This is another example where tabs for indenting (which I prefer) would have reduced confusion 🤓

Choose a reason for hiding this comment

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

I'm used to adding/removing just one # char by hand. Anyway, if IDEs do it the way you describe then I guess I need to adapt.

Copy link
Member

@Frenzie Frenzie Sep 11, 2025

Choose a reason for hiding this comment

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

I misunderstood the initial comment. The diff makes it look aligned with what's above.

Anyway, if IDEs do it the way you describe then I guess I need to adapt.

Geany (Scintilla) does something clever I wish other editors did too btw: it'll write //~, #~ etc. to distinguish a human comment from a machine-assisted comment. It nearly completely removes the accidental uncommenting that sometimes occurs in other editors.

Specifically, if you didn't add the extra comment in front of # Optional healthcheck section: you might accidentally turn it into a syntax error when uncommenting. Scintilla-style commenting makes it so you don't have to be nearly as precise in where you add or remove comments.

@schildbach
Copy link

I just tested this locally, and the health check works. I didn't test a failure case however.

            "Health": {
                "Status": "healthy",
                "FailingStreak": 0,
                "Log": [
                    {
                        "Start": "2025-09-11T00:31:17.938021194+02:00",
                        "End": "2025-09-11T00:31:18.040876228+02:00",
                        "ExitCode": 0,
                        "Output": ""
                    }
                ]
            }

Copy link

@schildbach schildbach left a comment

Choose a reason for hiding this comment

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

Consider this approved, with or without the code comment.

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

Script's good, didn't check the Docker part (but lgtm)

@Alkarex Alkarex merged commit c8da217 into FreshRSS:edge Sep 11, 2025
1 check passed
@Alkarex Alkarex deleted the docker-health branch September 11, 2025 07:43
homelab-alpha added a commit to homelab-alpha/docker that referenced this pull request Sep 28, 2025
- Replaced the custom inline PHP healthcheck with the official FreshRSS health script (`cli/health.php`).
- Improves maintainability and aligns with upstream changes from FreshRSS PR #7945.
- Ensures better compatibility and easier debugging.

Refs FreshRSS/FreshRSS#7945
homelab-alpha added a commit to homelab-alpha/docker that referenced this pull request Sep 28, 2025
- Replaced the custom inline PHP healthcheck with the official FreshRSS health script (`cli/health.php`).
- Improves maintainability and aligns with upstream changes from FreshRSS PR #7945.
- Ensures better compatibility and easier debugging.

Refs FreshRSS/FreshRSS#7945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docker 🐋 Everything related to Docker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Docker automatic Healthcheck seems to be missing

3 participants