oks
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Triono Putra 2025-06-05 07:04:01 +07:00
parent 48423687c2
commit d3831fd510
2 changed files with 21 additions and 2 deletions

View File

@ -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"]

14
entrypoint.sh Normal file
View File

@ -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