diff --git a/x86-QEMU-Docker.ign b/x86-QEMU-Docker.ign index f3952ad..a69bbaa 100644 --- a/x86-QEMU-Docker.ign +++ b/x86-QEMU-Docker.ign @@ -247,14 +247,14 @@ "name": "gvisor-updater.service" }, { - "contents": "[Unit]\nDescription=Update containers with Docker-Compose\nRequires=network-online.target\nRequires=docker.service\n\n[Service]\nWorkingDirectory=/path/to/directory\nType=oneshot\nExecStart=/usr/bin/docker image prune -f\n#ExecStart=/usr/bin/git pull\nExecStart=/usr/bin/docker compose pull\nExecStart=/usr/bin/docker compose up -d\n", + "contents": "[Unit]\nDescription=Docker Compose Updater for /srv/%I\nAfter=docker.service\nRequires=network-online.target\nRequires=docker.service\n\n[Service]\nType=oneshot\nUser=root\nGroup=root\nWorkingDirectory=/srv/%i\nExecStart=/usr/bin/docker image prune -f -a --filter 'until=240h'\n#ExecStart=/usr/bin/git pull\nExecStart=/usr/bin/docker compose pull\nExecStart=/usr/bin/docker compose up -d\n", "enabled": false, - "name": "docker-compose-updater.service" + "name": "docker-compose-updater@.service" }, { - "contents": "[Unit]\nDescription=Run docker-compose-updater once a week, 15 minutes after OS update\n\n[Timer]\nOnCalendar=Fri 0:15\nPersistent=true\n\n[Install]\nWantedBy=timers.target\n", + "contents": "[Unit]\nDescription=Run docker-compose-updater for /srv/%I once a week, 15 mintues after OS updates\n\n[Timer]\nOnCalendar=Fri 0:15\nPersistent=true\n\n[Install]\nWantedBy=timers.target\n", "enabled": false, - "name": "docker-compose-updater.timer" + "name": "docker-compose-updater@.timer" }, { "enabled": true, diff --git a/x86-QEMU-Docker.yml b/x86-QEMU-Docker.yml index a32fdc7..b4e19c3 100644 --- a/x86-QEMU-Docker.yml +++ b/x86-QEMU-Docker.yml @@ -125,26 +125,29 @@ systemd: [Install] WantedBy=multi-user.target - - name: docker-compose-updater.service + - name: docker-compose-updater@.service enabled: false contents: | [Unit] - Description=Update containers with Docker-Compose + Description=Docker Compose Updater for /srv/%I + After=docker.service Requires=network-online.target Requires=docker.service [Service] - WorkingDirectory=/path/to/directory Type=oneshot - ExecStart=/usr/bin/docker image prune -f + User=root + Group=root + WorkingDirectory=/srv/%i + ExecStart=/usr/bin/docker image prune -f -a --filter 'until=240h' #ExecStart=/usr/bin/git pull ExecStart=/usr/bin/docker compose pull ExecStart=/usr/bin/docker compose up -d - - name: docker-compose-updater.timer + - name: docker-compose-updater@.timer enabled: false contents: | [Unit] - Description=Run docker-compose-updater once a week, 15 minutes after OS update + Description=Run docker-compose-updater for /srv/%I once a week, 15 mintues after OS updates [Timer] OnCalendar=Fri 0:15