chore(docker): add docker support
This commit is contained in:
41
docker/docker-entrypoint.sh
Normal file
41
docker/docker-entrypoint.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Starting Cachet initialization..."
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
if [ ! -f ".env" ]; then
|
||||
echo "Creating .env file from .env.example..."
|
||||
cp .env.example .env
|
||||
fi
|
||||
|
||||
if [ -z "$APP_KEY" ] || [ "$APP_KEY" = "" ]; then
|
||||
echo "Generating application key..."
|
||||
php artisan key:generate --force
|
||||
fi
|
||||
|
||||
echo "Caching configuration..."
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan view:cache
|
||||
|
||||
echo "Publishing Cachet assets..."
|
||||
php artisan vendor:publish --tag=cachet --force
|
||||
|
||||
echo "Publishing Filament assets..."
|
||||
php artisan filament:assets
|
||||
|
||||
echo "Running database migrations..."
|
||||
php artisan migrate --force
|
||||
|
||||
echo "Creating storage symlink..."
|
||||
php artisan storage:link || true
|
||||
|
||||
echo "Setting permissions..."
|
||||
chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache
|
||||
|
||||
echo "Cachet initialization complete!"
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user