Add entrypoint script for better container startup and debugging
Some checks failed
Deploy Production Email Reports (Unified) / deploy (push) Failing after 18s
Some checks failed
Deploy Production Email Reports (Unified) / deploy (push) Failing after 18s
This commit is contained in:
@@ -22,6 +22,10 @@ COPY . /app/
|
||||
RUN mkdir -p /app/daily_order_reports_crew /app/daily_order_reports_merchbay && \
|
||||
chmod 755 /app/daily_order_reports_crew /app/daily_order_reports_merchbay
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
# Create crontab with both reports
|
||||
RUN echo "55 23 * * * BRAND=crew php /app/send_report.php >> /var/log/cron.log 2>&1" > /etc/crontabs/root && \
|
||||
echo "56 23 * * * BRAND=merchbay php /app/send_report.php >> /var/log/cron.log 2>&1" >> /etc/crontabs/root && \
|
||||
@@ -35,5 +39,5 @@ RUN touch /var/log/cron.log && \
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD ps aux | grep -v grep | grep -q crond || exit 1
|
||||
|
||||
# Start cron in foreground
|
||||
CMD crond -f -l 2
|
||||
# Use entrypoint script
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user