healthchecks: django compress before collectstatic

Previously, collectstatic was called before compress, causing it to miss certain libraries (namely moment.js) that prevent the Events list from displaying properly. This also matches the suggested order in the healthchecks documentation:
> Management commands that need to be run during each version upgrade.
> - manage.py compress – creates combined JS and CSS bundles and places them in the static-collected directory.
> - manage.py collectstatic – collects static files in the static-collected directory.
This commit is contained in:
cfjqve
2026-08-14 23:52:12 +00:00
parent 8ff36cc4da
commit b3a84f85bd

View File

@@ -239,11 +239,14 @@ in
serviceConfig = commonConfig // {
Restart = "always";
ExecStartPre = [
"${pkg}/opt/healthchecks/manage.py collectstatic --no-input"
"${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input"
]
++ lib.optionals (cfg.settings.DEBUG != "True") [ "${pkg}/opt/healthchecks/manage.py compress" ];
ExecStartPre =
lib.optionals (cfg.settings.DEBUG != "True") [
"${pkg}/opt/healthchecks/manage.py compress"
]
++ [
"${pkg}/opt/healthchecks/manage.py collectstatic --no-input"
"${pkg}/opt/healthchecks/manage.py remove_stale_contenttypes --no-input"
];
ExecStart = ''
${pkgs.python3Packages.gunicorn}/bin/gunicorn hc.wsgi \
--bind ${cfg.listenAddress}:${toString cfg.port} \