diff --git a/docker/deploy/etc/s6-overlay/scripts/laravel-automations b/docker/deploy/etc/s6-overlay/scripts/laravel-automations index 32c91eb16..b5286cbdd 100644 --- a/docker/deploy/etc/s6-overlay/scripts/laravel-automations +++ b/docker/deploy/etc/s6-overlay/scripts/laravel-automations @@ -15,6 +15,27 @@ chown -R webuser:webgroup $WEBUSER_HOME echo "✅ Permissions fixed." echo "" +if [ ${DB_CONNECTION:="sqlite"} = "sqlite" ]; then + # create symlinks + echo "🔗 Creating database symlink..." + symlinks=( \ + /var/www/html/database/database.sqlite \ + ) + + for i in "${symlinks[@]}" + do + if [[ -e "$i" && ! -L "$i" ]]; then + rm -rf "$i" + fi + if [[ ! -L "$i" ]]; then + ln -s /config/"$(basename "$i")" "$i" + fi + done + + echo "✅ Database symlink created." + echo "" +fi + # Check for env file if [ ! -f /config/.env ]; then echo "🙄 Environment file not found, creating..."