DONE: add docker config setup for local docker development

This commit is contained in:
ISMAIL MASSERAN
2026-10-04 15:53:05 +08:00
parent 937b892000
commit 8f0e83ee11
10 changed files with 370 additions and 324 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
set -e
cd /var/www/html
if [ ! -f .env ] && [ -f .env.docker.example ]; then
cp .env.docker.example .env
fi
if [ -f composer.json ]; then
if [ -f vendor/autoload.php ] && [ "${USE_STAGING_ENV:-false}" = "true" ]; then
: # vendor is baked into the staging image
elif [ "${USE_STAGING_ENV:-false}" = "true" ]; then
composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader --no-scripts
else
composer install --no-interaction --prefer-dist --no-scripts
fi
php artisan package:discover --ansi || true
fi
mkdir -p \
storage/logs \
storage/framework/cache/data \
storage/framework/views \
storage/framework/sessions \
storage/app/public \
bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
if [ -f .env ] && ! grep -qE '^APP_KEY=.+' .env; then
php artisan key:generate --force --ansi || true
fi
exec docker-php-entrypoint "$@"