forked from SchulIT/icc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup.sh
43 lines (32 loc) · 1.25 KB
/
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
CONTAINER_ALREADY_STARTED="ICC_CONTAINER_ALREADY_STARTED"
# Check if the container has already been started
if [ ! -e $CONTAINER_ALREADY_STARTED ]; then
touch $CONTAINER_ALREADY_STARTED
echo "-- First container startup --"
# Build and install the js files and translations as well as assets
php bin/console bazinga:js-translation:dump assets/js/ --merge-domains
npm run build
php bin/console assets:install
# Grant write permissions to the storage and bootstrap/cache directories
chown -R www-data:www-data /var/www/html/var
chown -R www-data:www-data /var/www/html/files
# Check if the SAML certificate does not exist
if [ ! -f /var/www/html/certs/sp.crt ] || [ ! -f /var/www/html/certs/sp.key ]; then
echo "Creating SAML certificate..."
# Create SAML certificate
php bin/console app:create-certificate --type saml --no-interaction
fi
# Cache leeren und aufwärmen
php bin/console cache:clear
# Run database migrations
php bin/console doctrine:migrations:migrate --no-interaction
# Perform initial setup
php bin/console app:setup
# Register cron jobs
php bin/console shapecode:cron:scan
fi
# Start PHP-FPM
php-fpm &
# Start Nginx
nginx -g 'daemon off;'