-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cronjob image with configurable cron expression
- Loading branch information
1 parent
4b472f8
commit 46f7f8c
Showing
5 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ARG COMMAND_VERSION=latest | ||
FROM ghcr.io/daniele-athome/immich-carddav-sync:${COMMAND_VERSION} as runtime | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y gettext-base cron | ||
|
||
COPY crontab.tmpl /app/crontab.tmpl | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Example of job definition: | ||
# .---------------- minute (0 - 59) | ||
# | .------------- hour (0 - 23) | ||
# | | .---------- day of month (1 - 31) | ||
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... | ||
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat | ||
# | | | | | | ||
# * * * * * user-name command to be executed | ||
${CRON_EXPRESSION} root cd / && PATH=/app/.venv/bin python -m immich_carddav_sync.main >/proc/1/fd/1 2>/proc/1/fd/2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
env >> /etc/environment | ||
|
||
export CRON_EXPRESSION=${IMMICH_CARDDAV_CRON_EXPRESSION} | ||
envsubst < /app/crontab.tmpl >/etc/cron.d/immich-carddav-sync | ||
|
||
exec cron -f |