Files
docker-phpbb/start.sh

28 lines
850 B
Bash
Raw Normal View History

2017-02-06 17:57:15 +03:00
#!/bin/sh
set -e
2018-08-22 19:51:17 +03:00
[[ "${PHPBB_INSTALL}" = "true" ]] && rm config.php
2017-02-06 17:57:15 +03:00
[[ "${PHPBB_INSTALL}" != "true" ]] && rm -rf install
db_wait() {
if [[ "${PHPBB_DB_WAIT}" = "true" && "${PHPBB_DB_DRIVER}" != "sqlite3" && "${PHPBB_DB_DRIVER}" != "sqlite" ]]; then
until nc -z ${PHPBB_DB_HOST} ${PHPBB_DB_PORT}; do
echo "$(date) - waiting for database on ${PHPBB_DB_HOST}:${PHPBB_DB_PORT} to start before applying migrations"
sleep 3
done
fi
}
db_migrate() {
if [[ "${PHPBB_DB_AUTOMIGRATE}" = "true" && "${PHPBB_INSTALL}" != "true" ]]; then
echo "$(date) - applying migrations"
2023-01-28 14:27:19 +03:00
su-exec apache php bin/phpbbcli.php db:migrate
2017-02-06 17:57:15 +03:00
fi
}
# Apache gets grumpy about PID files pre-existing
rm -f /run/apache2/httpd.pid
db_wait && db_migrate && exec httpd -DFOREGROUND "$@"