hedgedoc: enable automatic updates of docker images

This commit is contained in:
Markus 2024-11-09 15:30:49 +01:00
parent 44f9505bef
commit d7c0716f4a
6 changed files with 40 additions and 1 deletions

View File

@ -6,6 +6,9 @@
- name: Restart hedgedoc
service: name=hedgedoc state=restarted
- name: Restart hedgedoc-reload
service: name=hedgedoc-reload state=restarted
- name: Restart nginx
service: name=nginx state=restarted

View File

@ -42,9 +42,21 @@
- Reload systemd
- Restart hedgedoc
- name: Systemd unit for hedgedoc-reload
template: src=hedgedoc-reload.{{ item }}.j2 dest=/etc/systemd/system/hedgedoc-reload.{{ item }}
with_items:
- "service"
- "timer"
notify:
- Reload systemd
- Restart hedgedoc-reload
- name: Start the hedgedoc service
service: name=hedgedoc state=started enabled=yes
- name: Enable auto update timer
service: name=hedgedoc-reload.timer state=started enabled=yes
- name: Enable monitoring
include_role: name=icinga-monitor tasks_from=http
vars:

View File

@ -1,4 +1,5 @@
version: "3"
---
version: "3.4"
services:
database:
image: postgres:13-alpine

View File

@ -0,0 +1,7 @@
[Unit]
Description=Refresh hedgedoc images
[Service]
Type=oneshot
ExecStart=/bin/systemctl reload-or-restart hedgedoc.service

View File

@ -0,0 +1,10 @@
[Unit]
Description=Refresh authentik images
Requires=authentik.service
After=authentik.service
[Timer]
OnCalendar=*:0/15
[Install]
WantedBy=timers.target

View File

@ -17,6 +17,8 @@ WorkingDirectory=/opt/hedgedoc
# Make sure no old containers are running
ExecStartPre=/usr/bin/docker-compose down -v
# Update images
ExecStartPre=-/usr/bin/docker-compose pull --quiet
# Compose up
ExecStart=/usr/bin/docker-compose up
@ -24,5 +26,9 @@ ExecStart=/usr/bin/docker-compose up
# Compose down, remove containers and volumes
ExecStop=/usr/bin/docker-compose down -v
# Refresh on reload
ExecReload=-/usr/bin/docker-compose pull --quiet
ExecReload=/usr/bin/docker-compose up -d
[Install]
WantedBy=multi-user.target