dummybot/docker-entrypoint.sh

17 lines
473 B
Bash

#!/bin/bash
# Change ownership and permissions
chown -R www-data:www-data /var/www
chmod -R 755 /var/www/storage
chmod -R 755 /var/www/bootstrap/cache
# Run migrations + seed on first boot if DB is empty
# (only if explicitly enabled; off by default to avoid surprise migrations)
if [ "${AUTO_MIGRATE:-0}" = "1" ]; then
echo "[entrypoint] AUTO_MIGRATE=1 -> running migrations"
php artisan migrate --force --no-interaction
fi
# Execute the main command
exec "$@"