Update Dockerfile
This commit is contained in:
19
htdocs/entrypoint.sh
Normal file
19
htdocs/entrypoint.sh
Normal 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
|
||||
Reference in New Issue
Block a user