diff --git a/Dockerfile b/Dockerfile index da5ecc3..7aa0756 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,4 +54,9 @@ RUN rm -f index.html \ && chmod 777 filestore \ && chmod -R 777 include/ -CMD apachectl -D FOREGROUND +# Copy custom entrypoint script +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Start both cron and Apache +CMD ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..d1f4ebe --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Start cron service +service cron start + +# Ensure daily cron jobs are executable +chmod +x /etc/cron.daily/* + +# Start Apache in the foreground (keeps the container alive) +apachectl -D FOREGROUND