Files
crewsportswear/docker-entrypoint.sh

24 lines
658 B
Bash

#!/bin/bash
set -e
# Create storage directory structure if it doesn't exist
mkdir -p storage/framework/views
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/logs
mkdir -p storage/app/public
mkdir -p bootstrap/cache
# Set proper permissions
chown -R www-data:www-data storage bootstrap/cache
chmod -R 775 storage bootstrap/cache
# Install/update Composer dependencies if vendor is missing or composer.json changed
if [ ! -f vendor/autoload.php ]; then
echo "vendor/autoload.php not found — running composer install..."
composer install --no-interaction --prefer-dist
fi
# Execute the main command
exec "$@"