1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2024-12-23 20:55:24 +00:00

Initial version

This commit is contained in:
rhy-jot 2013-08-16 23:41:19 -07:00
commit 070274df73
6 changed files with 118 additions and 0 deletions

20
README.md Normal file
View File

@ -0,0 +1,20 @@
# NGINX Buildpack
**Note**: This has only been tested with [dokku](https://github.com/progrium/dokku) - it may not work elsewhere.
## Structure
* .nginx - File: its presence signals that this buildpack should be used
* www - Folder: holds all files to be served by nginx
* nginx.conf.erb - Optional File: overrides `conf/nginx.conf.erb`
* mime.types - Optional File: overrides `conf/mime.types`
## License (MIT)
Copyright (C) 2013 rhy-jot
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

15
bin/compile Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -e
apt-get update
apt-get -y install nginx
BINDIR=$(dirname "$0")
if [[ ! -f $1/nginx.conf.erb ]]; then
cp $BINDIR/../conf/nginx.conf.erb $1/nginx.conf.erb
fi
if [[ ! -f $1/mime.types ]]; then
cp $BINDIR/../conf/mime.types $1/mime.types
fi

9
bin/detect Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
if [[ -f $1/.nginx ]]; then
echo "nginx"
exit 0
else
exit 1
fi

8
bin/release Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e
cat << EOF
---
default_process_types:
web: erb $1/nginx.conf.erb > $1/nginx.conf && nginx -c /app/nginx.conf
EOF

48
conf/mime.types Normal file
View File

@ -0,0 +1,48 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
text/plain txt;
text/x-component htc;
text/mathml mml;
image/png png;
image/x-icon ico;
image/x-jng jng;
image/vnd.wap.wbmp wbmp;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/pdf pdf;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/zip zip;
application/octet-stream deb;
application/octet-stream bin exe dll;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/mpeg mp3;
audio/x-realaudio ra;
video/mpeg mpeg mpg;
video/quicktime mov;
video/x-flv flv;
video/x-msvideo avi;
video/x-ms-wmv wmv;
video/x-ms-asf asx asf;
video/x-mng mng;
}

18
conf/nginx.conf.erb Normal file
View File

@ -0,0 +1,18 @@
worker_processes 1;
error_log error.log;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
}
http {
include mime.types;
server {
listen <%= ENV['PORT'] %>;
server_name _;
root /app/www;
index index.html;
}
}