diff --git a/.gitignore b/.gitignore index 912d44b..70c915d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,6 @@ vendor/* !vendor/.gitkeep -bin/wp -!bin/.gitkeep - # WordPress core htdocs/wordpress diff --git a/Dockerfile-herokuphp b/Dockerfile-herokuphp index f60774b..d6be44f 100644 --- a/Dockerfile-herokuphp +++ b/Dockerfile-herokuphp @@ -83,6 +83,6 @@ ONBUILD ADD . /app/user/ # run install hooks ONBUILD RUN cat composer.json | python -c 'import sys,json; sys.exit("post-install-cmd" not in json.load(sys.stdin).get("scripts", {}));' && composer run-script post-install-cmd || true -# TODO: run "composer compile", like Heroku? +# Export heroku bin +ENV PATH /app/user/bin:$PATH -# ENTRYPOINT ["/usr/bin/init.sh"] diff --git a/bin/wp b/bin/wp new file mode 100755 index 0000000..1efd8f1 --- /dev/null +++ b/bin/wp @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +exec /app/user/vendor/bin/wp "$@" --allow-root diff --git a/composer.json b/composer.json index cf58a1c..713fdeb 100644 --- a/composer.json +++ b/composer.json @@ -48,8 +48,7 @@ }, "scripts": { "post-install-cmd": [ - "/bin/bash -c \"rm -r htdocs/wordpress/wp-content && ln -s ../wp-content htdocs/wordpress/wp-content\"", - "/bin/bash -c \"[[ -f bin/wp ]] || ln -s vendor/wp-cli/wp-cli/bin/wp bin/wp\"" + "/bin/bash -c \"rm -r htdocs/wordpress/wp-content; ln -s ../wp-content htdocs/wordpress/wp-content\"" ] } }