kimai2/nginx-alpine/50-kimai-init.sh
2019-07-08 11:20:18 -05:00

15 lines
820 B
Bash

#!/bin
echo Refreshing .env file...
echo APP_ENV=${APP_ENV} > /app/.env
echo DATABASE_URL=${DATABASE_URL} >> /app/.env
echo MAILER_FROM=${MAILER_FROM} >> /app/.env
echo MAILER_URL=${MAILER_URL} >> /app/.env
chown ${APPLICATION_UID}:${APPLICATION_GID} /app/.env
su -c "/app/bin/console cache:clear --env=${APP_ENV} || true" -l application
su -c "cd /app && composer install --optimize-autoloader || true" -l application
su -c "/app/bin/console doctrine:schema:create || true" -l application
su -c "/app/bin/console doctrine:migrations:version --add --all -n || true" -l application
su -c "/app/bin/console cache:warmup --env=${APP_ENV} || true" -l application
su -c "/app/bin/console kimai:create-user ${APP_ADMIN_USER} ${APP_ADMIN_EMAIL} ROLE_SUPER_ADMIN ${APP_ADMIN_PASS} --env=${APP_ENV} -vvv || true" -l application