Skip to content

Commit

Permalink
Add --allow-root for wp-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed May 14, 2017
1 parent 25bd032 commit 0a47709
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -5,9 +5,6 @@
vendor/*
!vendor/.gitkeep

bin/wp
!bin/.gitkeep

# WordPress core
htdocs/wordpress

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-herokuphp
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions bin/wp
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

exec /app/user/vendor/bin/wp "$@" --allow-root
3 changes: 1 addition & 2 deletions composer.json
Expand Up @@ -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\""
]
}
}

0 comments on commit 0a47709

Please sign in to comment.