1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2025-06-26 18:40:45 +00:00

Merge pull request #2 from florianheinemann/master

florianheinemann updates
This commit is contained in:
Michael Hobbs
2015-11-25 10:22:57 -08:00
3 changed files with 23 additions and 7 deletions

View File

@ -26,6 +26,8 @@ if [[ ! -e "$BUILD_DIR/www" ]]; then
mv $BUILD_DIR/* $CACHE_DIR/www
mkdir -p $BUILD_DIR/www
mv $CACHE_DIR/www/* $BUILD_DIR/www
# Check for an copy the nginx conf file override to the build dir
[[ -f "$BUILD_DIR/www/nginx.conf.erb" ]] && mv $BUILD_DIR/www/nginx.conf.erb $BUILD_DIR
[[ -f "$BUILD_DIR/www/CHECKS" ]] && mv $BUILD_DIR/www/CHECKS $BUILD_DIR
rm -rf $CACHE_DIR/www
fi
@ -114,11 +116,18 @@ EOF
cd $CUR_DIR
# build nginx config unless overridden by user
#if [ ! -f $BUILD_DIR/nginx/nginx.conf ] ; then
echo "-----> using default nginx.conf.erb"
cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb
#fi
# Test for user override on nginx config...
if [ -f $BUILD_DIR/nginx.conf.erb ] ; then
echo "-----> using user provided nginx.conf.erb"
cp $BUILD_DIR/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb
#rm $BUILD_DIR/nginx.conf.erb
# ...else, force default file
else
echo "-----> using default nginx.conf.erb"
cp conf/nginx.conf.erb $BUILD_DIR/nginx/nginx.conf.erb
fi
# build mime.types unless overridden by user
#if [ ! -f $BUILD_DIR/mime.types ] ; then
@ -131,6 +140,6 @@ cat <<EOF >"$BUILD_DIR/start_nginx"
#!/usr/bin/env bash
rm -f /app/nginx/nginx.conf
erb /app/nginx/nginx.conf.erb > /app/nginx/nginx.conf
exec nginx -p /app/nginx -c /app/nginx/nginx.conf
exec /app/nginx/nginx -p /app/nginx -c /app/nginx/nginx.conf
EOF
chmod +x "$BUILD_DIR/start_nginx"