#!/usr/bin/env bash # casjaysdevdocker/ampache - launches php-fpm84 (background) then httpd (foreground). # # Single command for the framework's EXEC_CMD_BIN slot. set -e mkdir -p /run/apache2 /run/php-fpm /tmp/php-sessions /data/logs/php-fpm /data/logs/apache2 chown -Rf apache:apache /run/apache2 /run/php-fpm /tmp/php-sessions /data/logs/php-fpm /data/logs/apache2 2>/dev/null || true # php-fpm: daemonize=no per our config; we put it in background here. if ! pgrep -x php-fpm84 >/dev/null 2>&1; then /usr/sbin/php-fpm84 --fpm-config /etc/php84/php-fpm.conf >>/data/logs/php-fpm/stdout.log 2>>/data/logs/php-fpm/stderr.log & # wait up to 10s for the unix socket i=0 while [ ! -S /run/php-fpm/php-fpm.sock ] && [ $i -lt 10 ]; do sleep 1; i=$((i+1)); done fi # httpd in foreground (-D FOREGROUND). exec /usr/sbin/httpd -D FOREGROUND -f /etc/apache2/httpd.conf