#!/bin/sh set -e cd /var/www/html # Point PHP/cURL at the system CA bundle and trust Sectigo R36/R46 for Shoraka TLS. if [ -f docker/php/php.ini ]; then cp docker/php/php.ini /usr/local/etc/php/conf.d/app.ini fi if [ -d docker/php/certs ]; then cp docker/php/certs/*.crt /usr/local/share/ca-certificates/ 2>/dev/null || true update-ca-certificates >/dev/null 2>&1 || true fi 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 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 chown -R www-data:www-data storage bootstrap/cache exec docker-php-entrypoint "$@"