2FAuth/docker/entrypoint.sh

35 lines
658 B
Bash
Raw Normal View History

2021-07-29 23:44:30 +02:00
#!/bin/bash
2021-07-29 23:52:34 +02:00
cleanup() {
set +e
echo "Stopping php7.3-fpm service..."
sudo service php7.3-fpm stop
}
trap cleanup 0
2021-07-29 23:52:11 +02:00
set -e
2021-07-29 23:44:30 +02:00
if [ "${DB_CONNECTION}" = "sqlite" ]; then
if [ ! -f /2fauth/.sqlite ]; then
touch /2fauth/.sqlite
fi
rm -f /srv/database/.sqlite
ln -sF /2fauth/.sqlite /srv/database/.sqlite
fi
sudo service php7.3-fpm start
sudo service php7.3-fpm status
if [ -f /2fauth/installed ]; then
php artisan migrate
php artisan config:clear
else
php artisan migrate:refresh
php artisan passport:install
php artisan storage:link
php artisan config:cache
echo "" > /2fauth/installed
fi
2021-07-29 23:52:51 +02:00
echo "Nginx listening on :8000"
2021-07-29 23:44:30 +02:00
nginx