diff --git a/Dockerfile b/Dockerfile index 961a4f8..0f42ee4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,14 +27,13 @@ COPY . . # Install Laravel dependencies RUN composer install --no-interaction --prefer-dist --optimize-autoloader -# Create storage folders (in case they don't exist) +# Buat folder cache jika belum ada RUN mkdir -p storage/framework/{cache,sessions,views} bootstrap/cache - +# Copy entrypoint COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh + EXPOSE 9000 -ENTRYPOINT ["/entrypoint.sh"] - - +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 7f8292b..d8c92c5 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,6 +9,9 @@ fi chown -R www-data:www-data /var/www chmod -R 775 /var/www/storage /var/www/bootstrap/cache chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache -php artisan key:generate + +# Generate app key (pakai --force agar tidak gagal di production) +php artisan key:generate --force + # Jalankan php-fpm exec php-fpm