Update Dockerfile

This commit is contained in:
servdal
2025-07-17 06:31:35 +07:00
parent cedb72d57f
commit 3237dbf10c
7 changed files with 53 additions and 13 deletions

19
htdocs/entrypoint.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Tunggu database siap
until php artisan migrate:status > /dev/null 2>&1; do
echo "Waiting for database to be ready..."
sleep 3
done
# Cek apakah migration sudah pernah dijalankan
if php artisan migrate:status | grep -q "| Y"; then
echo "Database already migrated, skipping migration and seeding."
else
echo "Running migrations and seeders..."
php artisan migrate --force
php artisan db:seed --force
fi
# Jalankan Laravel server
exec php artisan serve --host=0.0.0.0 --port=8080