Add Docker entrypoint and cleanup gitignore

- Add entrypoint.sh for automated app initialization (composer, npm, migrations, cache)
- Update Dockerfile: run entrypoint as root, php-fpm workers still run as appuser
- Update .gitignore: exclude storage/logs, storage/framework, bootstrap/cache, public/build
- Remove generated/cached files from git tracking
This commit is contained in:
root
2026-04-05 19:50:55 +02:00
parent 50f28292ef
commit d38d8b7896
29 changed files with 15 additions and 3141 deletions

View File

@@ -5,6 +5,12 @@ echo "========================================="
echo " TerManager2 - Entrypoint"
echo "========================================="
# -----------------------------------------------
# 0. Fix permissions & git safe directory
# -----------------------------------------------
git config --global --add safe.directory /var/www/html
chown -R appuser:appuser /var/www/html/storage /var/www/html/bootstrap/cache
# -----------------------------------------------
# 1. Composer install
# -----------------------------------------------
@@ -87,6 +93,11 @@ echo "========================================="
echo " TerManager2 - Ready!"
echo "========================================="
# -----------------------------------------------
# Fix final ownership
# -----------------------------------------------
chown -R appuser:appuser /var/www/html/vendor /var/www/html/node_modules /var/www/html/public/build /var/www/html/storage /var/www/html/bootstrap/cache 2>/dev/null || true
# -----------------------------------------------
# Execute CMD (default: php-fpm)
# -----------------------------------------------