mirror of
https://github.com/resourcespace/docker.git
synced 2025-10-07 10:04:27 +00:00
Add entrypoint.sh script to start Apache and cron and make Dockerfile run it after building
This commit is contained in:
@@ -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
10
entrypoint.sh
Normal 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
|
Reference in New Issue
Block a user