Created
November 27, 2019 16:45
-
-
Save danilin-em/340ffaea1234322888a41f12767da06f to your computer and use it in GitHub Desktop.
Docker Entrypoint for PHP Alpine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
COMPOSER_BIN=/usr/local/bin/composer | |
if [ "$SKIP_COMPOSER" == "false" ]; then | |
if [ ! -f $COMPOSER_BIN ]; then | |
curl -sS https://getcomposer.org/installer | php | |
mv composer.phar $COMPOSER_BIN | |
fi | |
if [ -f /var/www/composer.json ]; then | |
$COMPOSER_BIN --working-dir=/var/www install | |
fi | |
fi | |
if [ ! -z "$XDEBUG_CONFIG" ]; then | |
apk add --no-cache $PHPIZE_DEPS | |
pecl install xdebug-2.8.0 | |
docker-php-ext-enable xdebug | |
fi | |
# first arg is `-f` or `--some-option` | |
if [ "${1#-}" != "$1" ]; then | |
set -- php-fpm "$@" | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment