Tstore/docker/entrypoint.sh

20 lines
466 B
Bash

#!/usr/bin/env sh
set -eu
mkdir -p storage/framework/cache/data storage/framework/sessions storage/framework/views bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache
if [ "${RUN_MIGRATIONS:-0}" = "1" ]; then
php artisan migrate --force
fi
if [ "${RUN_ADMIN_SEEDER:-0}" = "1" ]; then
php artisan db:seed --class="Database\\Seeders\\AdminUserSeeder" --force
fi
if [ "${RUN_OPTIMIZE:-0}" = "1" ]; then
php artisan optimize
fi
exec "$@"