test second dockeerfile
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m55s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Has been skipped
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
Some checks failed
Build, Push and Deploy / build-and-push (push) Failing after 1m55s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 14s
Build, Push and Deploy / deploy-staging (push) Has been skipped
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
52
entrypoint2.sh
Normal file
52
entrypoint2.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "========================================"
|
||||
echo "Starting KulakPOS Container Setup..."
|
||||
echo "========================================"
|
||||
|
||||
# Tampilkan info dasar untuk debugging
|
||||
echo "Current user: $(whoami)"
|
||||
echo "Current directory: $(pwd)"
|
||||
|
||||
# 1. Fallback untuk kelengkapan env (agar container minimal bisa booting)
|
||||
if [ ! -f .env ]; then
|
||||
echo "⚠️ .env tidak ditemukan!"
|
||||
if [ -f .env.example ]; then
|
||||
echo "Menyalin dari .env.example..."
|
||||
cp .env.example .env
|
||||
fi
|
||||
fi
|
||||
|
||||
# 2. Pastikan permission path krusial aman (berguna jika terkena Volume Mount di Docker Compose)
|
||||
echo "Menyesuaikan izin (permissions) untuk storage & bootstrap/cache..."
|
||||
mkdir -p storage/framework/cache/data storage/framework/sessions storage/framework/views storage/framework/testing storage/logs bootstrap/cache
|
||||
chown -R www-data:www-data storage bootstrap/cache
|
||||
chmod -R 775 storage bootstrap/cache
|
||||
|
||||
# 3. Bersihkan cache instalasi/config lama
|
||||
echo "Membersihkan cache Laravel..."
|
||||
php artisan config:clear || true
|
||||
|
||||
|
||||
# 4. Verifikasi Vite Build
|
||||
if [ -f public/build/manifest.json ]; then
|
||||
echo "✅ Vite manifest ditemukan."
|
||||
else
|
||||
echo "⚠️ Peringatan: Vite manifest public/build/manifest.json tidak ditemukan."
|
||||
fi
|
||||
|
||||
# ========================================
|
||||
# PENTING: Dihilangkan dari script ini:
|
||||
# - composer install (Sudah dijamin ada pada Dockerfile, bukan di runtime)
|
||||
# - chmod 777 (Diganti menjadi 775 dan chown www-data)
|
||||
# - php -S (Kita standarkan aplikasi menggunakan php-fpm murni dari CMD Dockerfile)
|
||||
# - Paksaan export APP_DEBUG
|
||||
# ========================================
|
||||
|
||||
echo "========================================"
|
||||
echo "Selesai. Menjalankan proses utama ($@)..."
|
||||
echo "========================================"
|
||||
|
||||
# Serahkan eksekusi ke CMD milik Dockerfile (yaitu php-fpm)
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user