Add entrypoint.sh script to start Apache and cron and make Dockerfile run it after building

This commit is contained in:
Chris Evans
2025-07-23 11:39:44 +01:00
parent ba0070c3be
commit 4fc6fc0c4f
2 changed files with 16 additions and 1 deletions

View File

@@ -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"]

10
entrypoint.sh Normal file
View File

@@ -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