periodically update docker container (Jinja-Compose)

This commit is contained in:
Daniel Langbein 2023-11-05 17:15:01 +01:00
parent a76f5d20ec
commit cc8d41cd68
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -121,12 +121,29 @@ in
];
};
# Start Jinja-Compose project during boot.
# To few the log, run
# Update and start Jinja-Compose project
# during boot and after every 30 minutes.
# To view the log, run
# journalctl -b -u Jinja-Compose -f
#
systemd.timers."Jinja-Compose" = {
wantedBy = [ "timers.target" ];
partOf = [ "Jinja-Compose.service" ];
timerConfig = {
OnBootSec = "0m";
OnUnitInactiveSec = "30m";
AccuracySec = "1m";
RandomizedDelaySec = "1m";
};
};
systemd.services."Jinja-Compose" = {
description = "Start Jinja-Compose project";
description = "Update and start Jinja-Compose project";
serviceConfig = {
Type = "oneshot";
PrivateTmp = true;
User = "root";
};
path = with pkgs; [
# The `docker-compose` helper script is written in `bash` (!)
bash
@ -137,7 +154,5 @@ in
/jc-config/docker-compose pull
/jc-config/docker-compose up -d --wait
'';
# Start after login.
wantedBy = [ "multi-user.target" ];
};
}