diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a03a555..9189268 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -30,11 +30,29 @@ echo " DB_HOST_CREW: ${DB_HOST_CREW:-not set}" echo " DB_HOST_MERCHBAY: ${DB_HOST_MERCHBAY:-not set}" echo " SMTP_HOST: ${SMTP_HOST:-not set}" -# Start crond in foreground +# Start crond in background echo "" -echo "Starting cron daemon in foreground..." +echo "Starting cron daemon..." echo "Logs will be written to:" echo " - Cron output: /var/log/cron.log" echo " - Email logs: /app/email.log" echo "" -exec crond -f -l 2 + +# Start crond in background +crond -l 2 + +# Verify crond started +sleep 2 +if ! ps aux | grep -v grep | grep -q crond; then + echo "ERROR: crond failed to start" + exit 1 +fi + +echo "✓ Cron daemon is running" +echo "" +echo "Container is ready. Tailing logs..." +echo "Press Ctrl+C to stop (but don't - this keeps the container alive!)" +echo "" + +# Keep container alive by tailing logs +tail -f /var/log/cron.log /app/email.log