From d3831fd510e87089bd16ad9d3c5b7ef79ee7a84b Mon Sep 17 00:00:00 2001 From: Triono Putra Date: Thu, 5 Jun 2025 07:04:01 +0700 Subject: [PATCH] oks --- Dockerfile | 9 +++++++-- entrypoint.sh | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index e25f001..532090b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,6 @@ WORKDIR /var/www # Copy project files COPY . . -COPY .env.example .env # Install Laravel dependencies RUN composer install --no-interaction --prefer-dist --optimize-autoloader @@ -39,5 +38,11 @@ RUN chown -R www-data:www-data /var/www \ && chmod -R 775 storage bootstrap/cache \ && chown -R www-data:www-data storage bootstrap/cache + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh EXPOSE 9000 -CMD ["php-fpm"] + +ENTRYPOINT ["/entrypoint.sh"] + + diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..b5dedb2 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Salin .env jika belum ada +if [ ! -f .env ]; then + cp .env.example .env +fi + +# Set ownership dan permission untuk Laravel +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 + +# Jalankan php-fpm +exec php-fpm