Skip to content

Commit 502dee5

Browse files
author
Ric Harvey
committed
Merge branch 'master' of git://github.com/SKoschnicke/nginx-php-fpm into SKoschnicke-master
2 parents c975c8b + 7f2ff02 commit 502dee5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

docs/repo_layout.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ One example would be, if you are running craft CMS you'll end up with a repo str
4444

4545
In this case __WEBROOT__ would be set as __/var/www/html/public__
4646

47+
Note that if you are managing dependencies with composer, your composer.json and composer.lock files should *always* be located in the repo root, not in the directory you set as __WEBROOT__.
48+
4749
### conf
4850
This directory is where you can put config files you call from your scripts. It is also home to the nginx folder where you can include custom nginx config files.
4951

scripts/pull

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if [ -z "$GIT_NAME" ]; then
1111
fi
1212

1313
# Try auto install for composer
14-
if [ -f "$WEBROOT/composer.lock" ]; then
15-
php composer.phar install --no-dev
14+
if [ -f "/var/www/html/composer.lock" ]; then
15+
composer install --no-dev --working-dir=/var/www/html
1616
fi
1717

1818
cd /var/www/html

scripts/start.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ fi
1717

1818
# Set custom webroot
1919
if [ ! -z "$WEBROOT" ]; then
20-
webroot=$WEBROOT
21-
sed -i "s#root /var/www/html;#root ${webroot};#g" /etc/nginx/sites-available/default.conf
22-
else
23-
webroot=/var/www/html
20+
sed -i "s#root /var/www/html;#root ${WEBROOT};#g" /etc/nginx/sites-available/default.conf
2421
fi
2522

2623
# Setup git variables
@@ -62,8 +59,8 @@ if [ ! -d "/var/www/html/.git" ]; then
6259
fi
6360

6461
# Try auto install for composer
65-
if [ -f "$WEBROOT/composer.lock" ]; then
66-
php composer.phar install --no-dev
62+
if [ -f "/var/www/html/composer.lock" ]; then
63+
composer install --no-dev --working-dir=/var/www/html
6764
fi
6865

6966
# Enable custom nginx config files if they exist

0 commit comments

Comments
 (0)