From c7b06c0cba388b78b3b899d78f25ba58e9145f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Mon, 20 Jan 2025 22:43:45 +0300 Subject: [PATCH] Enhance Dockerfile for Laravel application with NTP support - Added NTP package installation to synchronize time within the container. - Configured a cron job for automatic time updates, improving time accuracy for scheduled tasks. - Updated file permission settings and added echo statements for better logging and clarity during setup. These changes enhance the Docker environment by ensuring accurate timekeeping, which is crucial for scheduled tasks in the Laravel application. --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8cdffe5..500c973 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -y \ libxml2-dev \ zip \ cron \ + ntp \ && docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd \ && echo "* * * * * cd /var/www && php artisan schedule:run >> /dev/null 2>&1" >> /etc/cron.d/laravel-cron \ && chmod 0644 /etc/cron.d/laravel-cron \ @@ -49,7 +50,9 @@ RUN set -x && \ chmod -R 775 /var/www/storage/framework/views && \ echo "Views izinleri ayarlandı" && \ chmod -R 775 /var/www/public && \ - echo "Public dizin izinleri ayarlandı" + echo "Public dizin izinleri ayarlandı" && \ + echo "0 0 * * * root /usr/sbin/ntpdate -u pool.ntp.org" >> /etc/crontab && \ + echo "Otomatik saat güncelleme ayarlandı" # Laravel uygulamasını başlatma ve loglama RUN set -x && \