chore(shell-sync): Dockerfile scaffolding

This commit is contained in:
hoelee committed 2026-04-24 12:17:00 +08:00
1 parent 946d761b12
commit 043a80c462
1 file changed
+13
+13
View File
@@ -68,3 +68,16 @@ RUN chmod +x /usr/local/bin/imapsync /usr/local/bin/oauth2_imap \
&& perl -c /usr/local/bin/oauth2_imap \
&& imapsync --version
# Copy entrypoint
COPY sync.sh /sync.sh
RUN chmod +x /sync.sh && bash -n /sync.sh
# Health is liveness plus notification delivery. Sync freshness is exposed by
# accountN.last_success / accountN.last_failure files for the chosen schedule.
HEALTHCHECK --interval=5m --timeout=10s --start-period=60s --retries=3 \
CMD test -f "${LOG_DIR:-/var/log/imapsync}/.heartbeat" && \
test ! -f "${LOG_DIR:-/var/log/imapsync}/.notification_failed" && \
test "$(cat "${LOG_DIR:-/var/log/imapsync}/.heartbeat")" -gt "$(date -d '5 minutes ago' +%s)" || \
{ echo "Health check failed: daemon heartbeat is stale or SMTP notification delivery failed. Check container logs."; exit 1; }
ENTRYPOINT ["/sync.sh"]