mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #1184] Support for docker compose _FILE secrets #808
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#808
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ionesculiviucristian on GitHub (Jul 6, 2025).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/1184
Hi. Is there any support for docker compose secrets now or in the future? Thanks.
@cuu508 commented on GitHub (Jul 8, 2025):
IIUC docker compose mounts secrets as files inside the container, and the convention is to use
_FILEenv variables pointing to the secrets files. For example, instead of:one might have
(with the text file containing "hunter2"). And it would be nice if Healthchecks understood and used these
_FILEenv variables.I'm thinking it makes sense to use secrets only for sensitive settings (keys, tokens, passwords), not every configuration setting. And it would make sense to support both DB_PASSWORD and DB_PASSWORD_FILE variants – so instance operators can use either one depending on their needs and preferences. Going through the existing settings, we would be adding the following new settings:
I think this makes sense to do. I'm currently in the middle of something and will need at least a month before I can work on this.
@ionesculiviucristian commented on GitHub (Jul 9, 2025):
Unfortunately this is not the standard in many docker images so I switched to env secrets until something changes. Regarding on what should be put in files, I'll go with all because it's an easy implementation and different users have different requirements. Issue can be closed if considered irrelevant.
@cuu508 commented on GitHub (Jul 10, 2025):
Sorry, can you please clarify – is (1) the current state of putting secrets directly in env variables or (2) what I proposed not standard?
@ionesculiviucristian commented on GitHub (Jul 13, 2025):
I'm saying than not everybody implements
_FILEin their docker images and there is no other workaround to that. It's either supported or not.@Cheezzhead commented on GitHub (Oct 24, 2025):
In the meantime, this functionality can be achieved with a custom script loaded as the entrypoint. I use this for all of my services that don't have built-in
_FILEsecrets support; the only downside (and the reason why I still prefer images to have this functionality built-in) is that you have to manually re-set the servicecommandfrom whatever the image originally had, as setting a customentrypointinvalidates the image's defaultCMDinstruction.(Note this script looks for
FILE__<name>environment variables)Example usage in a compose service definition:
@techsolo12 commented on GitHub (Nov 26, 2025):
@cuu508: Is there an update to this topic? I would appreciate it if we could get this feature in the future.
@techsolo12 commented on GitHub (Dec 1, 2025):
Quick feedback: The new security feature is working fine for me. @cuu508: Thank you for implementing it so quickly!