-
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
bc8301f
commit 5490b49
Showing
4 changed files
with
23 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
ARG COMMAND_VERSION=latest | ||
FROM ghcr.io/daniele-athome/immich-carddav-sync:${COMMAND_VERSION} | ||
FROM ghcr.io/daniele-athome/immich-carddav-sync:${COMMAND_VERSION} as runtime | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y cron | ||
RUN apt-get update && apt-get install --no-install-recommends -y gettext-base cron | ||
|
||
COPY cronjob.sh /etc/cron.daily/immich-carddav-sync | ||
RUN chmod 0755 /etc/cron.daily/immich-carddav-sync | ||
COPY crontab.tmpl /app/crontab.tmpl | ||
|
||
ENTRYPOINT ["cron", "-f"] | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
#!/bin/sh | ||
|
||
env >> /etc/environment | ||
|
||
envsubst < /app/crontab.tmpl >/etc/cron.d/immich-carddav-sync | ||
|
||
exec cron -f |