diff --git a/docker-compose.yml b/docker-compose.yml index eba84be1..1e1bdf64 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: api: build: ./api user: "${UID:?Set UID env variable to your user id}" + container_name: "outdated-api" depends_on: - db ember: diff --git a/systemd/notifications.service b/systemd/notifications.service new file mode 100644 index 00000000..ed1c9f5d --- /dev/null +++ b/systemd/notifications.service @@ -0,0 +1,9 @@ +[Unit] +Description=Send email notifications to users +Wants=notifications.timer + +[Service] +ExecStart=docker exec outdated-api sh -c './manage.py notify' + +[Install] +WantedBy=multi-user.target diff --git a/systemd/notifications.timer b/systemd/notifications.timer new file mode 100644 index 00000000..1e3c58d1 --- /dev/null +++ b/systemd/notifications.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Send notifications every monday morning + +[Timer] +Unit=notifications.service +OnCalendar=Mon *-*-* 00:00:00 + +[Install] +WantedBy=timers.target diff --git a/systemd/syncprojects.service b/systemd/syncprojects.service new file mode 100644 index 00000000..27fa6483 --- /dev/null +++ b/systemd/syncprojects.service @@ -0,0 +1,9 @@ +[Unit] +Description=Synchronise projects +Wants=syncprojects.timer + +[Service] +ExecStart=docker exec outdated-api sh -c './manage.py syncprojects' + +[Install] +WantedBy=multi-user.target diff --git a/systemd/syncprojects.timer b/systemd/syncprojects.timer new file mode 100644 index 00000000..a367ef22 --- /dev/null +++ b/systemd/syncprojects.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Send notifications every monday morning + +[Timer] +Unit=syncprojects.service +OnCalendar=Mon *-*-* 00:00:00 + +[Install] +WantedBy=timers.target