AzuraCast/util/docker/web/service.full/php-fpm/run

26 lines
901 B
Bash

#!/bin/bash
source /etc/container_environment.sh
if [ -f /etc/service/mariadb/run ]; then
sv -w 30 check mariadb || exit 1
fi
if [ -f /etc/service/redis/run ]; then
sv -w 30 check redis || exit 1
fi
# Set up PHP config
dockerize -template "/etc/php/${PHP_VERSION}/fpm/05-azuracast.ini.tmpl:/etc/php/${PHP_VERSION}/fpm/conf.d/05-azuracast.ini" \
-template "/etc/php/${PHP_VERSION}/fpm/www.conf.tmpl:/etc/php/${PHP_VERSION}/fpm/pool.d/www.conf" \
cp /etc/php/${PHP_VERSION}/fpm/conf.d/05-azuracast.ini /etc/php/${PHP_VERSION}/cli/conf.d/05-azuracast.ini
# Wait for services to spin up.
gosu azuracast php /var/azuracast/www/bin/uptime_wait || exit 1
# Initialize before running FPM
gosu azuracast azuracast_cli azuracast:setup:initialize || exit 1
# Run PHP-FPM
exec /usr/sbin/php-fpm${PHP_VERSION} -F --fpm-config /etc/php/${PHP_VERSION}/fpm/php-fpm.conf -c /etc/php/${PHP_VERSION}/fpm/