Files
email_reports/docker-entrypoint.sh
Frank John Begornia afa05d272e
Some checks failed
Deploy Production Email Reports (Unified) / deploy (push) Failing after 18s
Add entrypoint script for better container startup and debugging
2026-01-02 01:44:36 +08:00

41 lines
976 B
Bash

#!/bin/sh
set -e
echo "Email Reports Container Starting..."
echo "Current time: $(date)"
echo "Timezone: $(date +%Z)"
# Verify crontab is configured
echo ""
echo "Cron schedule:"
crontab -l || echo "Warning: No crontab found"
# Create log file if it doesn't exist
touch /var/log/cron.log
chmod 666 /var/log/cron.log
# Create email log if it doesn't exist
touch /app/email.log
chmod 666 /app/email.log
# Test PHP
echo ""
echo "Testing PHP..."
php -v || { echo "PHP test failed"; exit 1; }
# Test database connectivity (optional - won't fail if not reachable)
echo ""
echo "Environment variables loaded:"
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
echo ""
echo "Starting cron daemon in foreground..."
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