#!/bin/sh set -e APP_DIR=/var/www/app if [ ! -d "$APP_DIR/.git" ]; then git clone -b "${GIT_BRANCH:-main}" "$GIT_REPO" "$APP_DIR" else cd "$APP_DIR" git pull origin "${GIT_BRANCH:-main}" fi cd "$APP_DIR" if [ -f composer.json ]; then composer install --no-interaction --prefer-dist --optimize-autoloader fi if [ -d storage ] && [ -d bootstrap/cache ]; then chown -R www-data:www-data storage bootstrap/cache fi exec "$@"