wordpress/entrypoint.sh.tmpl

22 lines
650 B
Cheetah
Raw Normal View History

2020-10-23 02:06:26 +00:00
#!/bin/bash
2020-10-24 18:13:56 +00:00
{{ if (env "PHP_EXTENSIONS") }}
2020-10-23 02:06:26 +00:00
docker-php-ext-install {{ env "PHP_EXTENSIONS" }}
2020-10-24 18:13:56 +00:00
{{ end }}
2022-03-30 23:24:33 +00:00
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
2023-10-17 21:29:23 +00:00
{{ 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 }}
2020-10-24 18:13:56 +00:00
if [ -n "$@" ]; then
"$@"
fi
2020-10-23 02:06:26 +00:00
# Upstream ENTRYPOINT
# https://github.com/docker-library/wordpress/blob/master/php7.4/apache/Dockerfile#L120
2020-10-24 18:13:56 +00:00
/usr/local/bin/docker-entrypoint.sh apache2-foreground