22 lines
650 B
Bash
22 lines
650 B
Bash
#!/bin/bash
|
|
|
|
{{ if (env "PHP_EXTENSIONS") }}
|
|
docker-php-ext-install {{ env "PHP_EXTENSIONS" }}
|
|
{{ end }}
|
|
|
|
curl -z /usr/local/bin/wp -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
|
chmod +x /usr/local/bin/wp
|
|
|
|
{{ if eq (env "CORS_ALLOW_ALL") "1" }}
|
|
a2enmod headers
|
|
sed -ri -e 's/^([ \t]*)(<\/VirtualHost>)/\1\tHeader set Access-Control-Allow-Origin "*"\n\1\2/g' /etc/apache2/sites-available/*.conf
|
|
{{ end }}
|
|
|
|
if [ -n "$@" ]; then
|
|
"$@"
|
|
fi
|
|
|
|
# Upstream ENTRYPOINT
|
|
# https://github.com/docker-library/wordpress/blob/master/php7.4/apache/Dockerfile#L120
|
|
/usr/local/bin/docker-entrypoint.sh apache2-foreground
|