Files
sugar-crm/docker-entrypoint.sh
root 30905b15d4
Some checks failed
Docker Build & Push / build-and-push (push) Has been cancelled
feat: SuiteCRM Docker + compose + CI/CD
2026-05-24 14:12:23 +02:00

23 lines
860 B
Bash

#!/bin/bash
set -e
# Fix permissions
chown -R www-data:www-data /var/www/html/cache /var/www/html/upload /var/www/html/custom 2>/dev/null || true
chmod -R 755 /var/www/html 2>/dev/null || true
chmod -R 775 /var/www/html/cache /var/www/html/upload /var/www/html/custom 2>/dev/null || true
# Generate SuiteCRM autoloader if missing
if [ ! -f /var/www/html/vendor/autoload.php ] && [ -f /var/www/html/composer.json ]; then
echo "Installing Composer dependencies..."
cd /var/www/html && composer install --no-dev --optimize-autoloader 2>/dev/null || true
fi
# Set recommended permissions
touch /var/www/html/config.php 2>/dev/null || true
chmod 640 /var/www/html/config.php 2>/dev/null || true
chown www-data:www-data /var/www/html/config.php 2>/dev/null || true
echo "SuiteCRM ready. Access http://localhost:8080 to complete installation."
exec "$@"