#!/usr/bin/env bash # run-digest.sh — single-shot wrapper invoked by cron. # Loads env from /etc/environment (cron's empty environment otherwise) # and pipes output to docker logs via a timestamped prefix. set -e # busybox crond doesn't carry container env. Re-export from /etc/environment # (Docker writes container envs there if you set DOCKER_ENV write — but # we can't rely on that). Simpler: source any envfile we drop in entrypoint. if [ -f /tmp/digest.env ]; then set -a; . /tmp/digest.env; set +a fi cd /app exec python3 /app/digest.py 2>&1 | sed "s/^/[$(date '+%H:%M:%S')] /"