-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Bedrock WordPress apps #134
base: master
Are you sure you want to change the base?
Changes from 3 commits
830c3ca
9a5d73e
fb7490d
496a1a5
e57ea4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
root /app/<%= ENV['DOCUMENT_ROOT'] %>; | ||
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
index index.php index.html; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|ttf|woff)$ { | ||
access_log off; | ||
} | ||
location /. { | ||
return 404; | ||
} | ||
location ~ \.php { | ||
include fastcgi_params; | ||
fastcgi_pass php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_buffers 256 4k; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,7 +196,7 @@ pm = static | |
; forget to tweak pm.* to fit your needs. | ||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' | ||
; Note: This value is mandatory. | ||
pm.max_children = 8 | ||
pm.max_children = 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why changing this ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was something i should have done in a branch to save memory on the my server that has many apps running on only 4 cores. I committed a revert of this for master. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am using this with dokku on a server with ~10 apps and the memory usage is a bit much with 8 php processes per app - epecially since I do not have 8 cores. I have moved this customization into another branch. |
||
|
||
; The number of child processes created on startup. | ||
; Note: Used only when pm is set to 'dynamic' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
BUILD_DIR="$2" | ||
basedir="$( cd -P "$( dirname "$0" )" && pwd )" | ||
|
||
function sets_framework_bedrock() { | ||
[ $(jq --raw-output '.extra.heroku.framework' < "$BUILD_DIR/composer.json") == "bedrock" ] | ||
} | ||
|
||
case "$1" in | ||
detect) | ||
if [ ! -f "$BUILD_DIR/composer.json" ]; then | ||
exit 1 | ||
fi | ||
|
||
if sets_framework_bedrock; then | ||
echo "-----> Detected Bedrock WordPress app" | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
;; | ||
compile) | ||
echo "-----> Setting up Bedrock WordPress app" | ||
cp "$basedir/../conf/nginx/bedrock.conf.erb" "$BUILD_DIR/conf/site.conf.erb" | ||
mkdir -p $BUILD_DIR/web/app/uploads | ||
chmod a+w -R $BUILD_DIR/web/app/uploads | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the goal of preventing the access to the url
/.
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry these should not have been part or the pull request - I should move them into another branch for my personal use. I forgot that all the changes I made to master would be added to the previous pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /. should have been ~ /. to block dotfiles. I guess as it was it blocked access to a folder named period in the root, which was dumb.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be careful to escape the dot in regexes though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I had it escaped in my comment - but it must have been removed by the parser. Commit e57ea4b has the correctly escaped regex version.