Last active
August 26, 2025 21:51
-
-
Save AstraLuma/d22c2ce78fb0744e469060dadf5020f7 to your computer and use it in GitHub Desktop.
docker+systemd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Compose app %i | |
Requires=docker.socket | |
[Install] | |
WantedBy=multi-user.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
WorkingDirectory=/etc/compose/%i | |
ExecStart=docker compose --ansi never up -d | |
ExecStop=docker compose --ansi never stop | |
ExecReload=docker compose --ansi never up -d --build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"log-driver": "journald" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Docker GC | |
Requires=docker.socket | |
[Service] | |
Type=oneshot | |
ExecStart=docker system prune --all --force --filter "until=168h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Daily Docker GC | |
After=docker.socket | |
[Install] | |
WantedBy=timers.target | |
[Timer] | |
OnCalendar=daily |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Journal] | |
Storage=persist | |
MaxRetentionSec=90day |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment