permission git
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Bind mount (./src:/var/www/html) menindih ownership dari image, jadi kita
|
||||
# betulkan permission storage setiap kali container start — bukan masa build.
|
||||
# storage/ & bootstrap/cache/ ialah named volume (lihat docker-compose.yml).
|
||||
# Pada mount pertama ia kosong, jadi kita cipta struktur penuh Laravel dan
|
||||
# betulkan permission setiap kali container start. Sebab ia named volume
|
||||
# (bukan bind mount host), chown ini TIDAK menyentuh fail git di host.
|
||||
mkdir -p \
|
||||
storage/app/public \
|
||||
storage/framework/cache/data \
|
||||
storage/framework/cache/laravel-excel \
|
||||
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
|
||||
|
||||
# Pautan symbolic untuk fail awam (idempotent)
|
||||
php artisan storage:link 2>/dev/null || true
|
||||
|
||||
# Jalankan arahan utama container (apache2-foreground)
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user