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.
This commit is contained in:
+4
-1
@@ -18,6 +18,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
zip \
|
zip \
|
||||||
cron \
|
cron \
|
||||||
|
ntp \
|
||||||
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd \
|
&& 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 \
|
&& echo "* * * * * cd /var/www && php artisan schedule:run >> /dev/null 2>&1" >> /etc/cron.d/laravel-cron \
|
||||||
&& chmod 0644 /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 && \
|
chmod -R 775 /var/www/storage/framework/views && \
|
||||||
echo "Views izinleri ayarlandı" && \
|
echo "Views izinleri ayarlandı" && \
|
||||||
chmod -R 775 /var/www/public && \
|
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
|
# Laravel uygulamasını başlatma ve loglama
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
|
|||||||
Reference in New Issue
Block a user