#!/bin/bash set -e SELF=$(basename "$0") # first arg is `-f` or `--some-option` if [ "${1#-}" != "$1" ]; then set -- php-fpm "$@" fi if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then echo "$SELF: /docker-entrypoint.d/ found, continuing to execute scripts" find "/docker-entrypoint.d/" -follow -type f -print | sort -V | while read -r f; do case "$f" in *.sh) if [ -x "$f" ]; then echo -e "$SELF: Launching $f"; "$f" else # warn on shell scripts without exec bit echo "$SELF: Ignoring $f, not executable"; fi ;; *) echo "$SELF: Ignoring $f";; esac done echo "$SELF: Configuration complete; ready for start up." else echo "$SELF: No files found in /docker-entrypoint.d/, skipping configuration." fi fi exec docker-php-entrypoint "$@"