Files
kaunter/docker/php/entrypoint.sh
ismailmasseran 1f8642e230
Build Docker Image / build-frontend (push) Successful in 15s
DONE: add cicd for staging (#1)
Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local>
Reviewed-on: #1
2026-08-26 13:36:18 +08:00

36 lines
884 B
Bash

#!/bin/sh
set -e
cd /var/www/html
if [ "${USE_STAGING_ENV:-false}" = "true" ] && [ -f .env.staging ]; then
cp .env.staging .env
fi
if [ -f composer.json ]; then
if [ -f vendor/autoload.php ] && [ "${USE_STAGING_ENV:-false}" = "true" ]; then
: # vendor is baked into the staging image
elif [ "${USE_STAGING_ENV:-false}" = "true" ]; then
composer install --no-interaction --prefer-dist --no-dev --optimize-autoloader --no-scripts
else
composer install --no-interaction --prefer-dist
fi
fi
mkdir -p \
storage/logs \
storage/framework/cache/data \
storage/framework/views \
storage/framework/sessions \
storage/app/public \
bootstrap/cache
if [ -f artisan ]; then
php artisan package:discover --ansi
php artisan storage:link --force >/dev/null 2>&1 || true
fi
chown -R www-data:www-data storage bootstrap/cache
exec docker-php-entrypoint "$@"