Add docker-compose.yml

This commit is contained in:
2025-05-03 13:52:39 +03:00
parent ab95fd889e
commit c1c01d27c1
3 changed files with 22 additions and 0 deletions
+14
View File
@@ -66,5 +66,19 @@ RUN mkdir -p /var/www/moodledata && \
# chown -R www-data:www-data /var/www/moodledata && \
chmod -R 770 /var/www/moodledata
# Set up Moodle cron job
COPY moodle-cron /etc/cron.d/moodle-cron
RUN chmod 0644 /etc/cron.d/moodle-cron && \
crontab /etc/cron.d/moodle-cron
# Create startup script to run cron and apache
COPY start.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/start.sh
# Set working directory
WORKDIR /var/www/html
# Set entrypoint to our startup script
ENTRYPOINT ["/usr/local/bin/start.sh"]
+2
View File
@@ -0,0 +1,2 @@
# Run Moodle cron every minute
* * * * * /usr/local/bin/php /var/www/html/admin/cli/cron.php > /dev/null 2>&1
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Start cron service
service cron start
# Start Apache in foreground
apache2-foreground