Adding custom nginx config support
This commit is contained in:
@@ -96,6 +96,9 @@ To pull a repository and specify a branch add the GIT_BRANCH environment variabl
|
||||
sudo docker run -d -e 'GIT_NAME=full_name' -e 'GIT_USERNAME=git_username' -e 'GIT_REPO=github.com/project' -e 'SSH_KEY=BIG_LONG_BASE64_STRING_GOES_IN_HERE' -e 'GIT_BRANCH=stage' richarvey/nginx-php-fpm:latest
|
||||
```
|
||||
|
||||
### Custom Nginx Config files
|
||||
Sometimes you need a custom config file for nginx to do rewrites or password protection, etc. For this reason we've included the ability to have custom nginx configs pulled directly from your git source. Please have a read of the [repo layout guidelines](docs/repo_layout.md) for more information. Its pretty simple to enable this, all you need to do is include a folder in the root of your repository called ```conf/nginx/``` within this folder you need to include a file called ```nginx-site.conf``` which will contain your default nginx site config. If you wish to have a custom file for SSL you simply include a file called ```nginx-site-ssl.conf``` in the same directory. These files will then be swapped in after you code is cloned.
|
||||
|
||||
### Scripting
|
||||
There is often an occasion where you need to run a script on code to do a transformation once code lands in the container. For this reason we have developed scripting support. By including a scripts folder in your git repository and passing the __RUN_SCRIPTS=1__ flag to your command line the container will execute your scripts. Please see the [repo layout guidelines](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/repo_layout.md) for more details on how to organise this.
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ However if you wish to use scripting support you'll want to split code and scrip
|
||||
- repo root (/var/www/html)
|
||||
- src
|
||||
- your code here
|
||||
- conf
|
||||
- nginx
|
||||
- default-site.conf
|
||||
- default-site-ssl.conf
|
||||
- scripts
|
||||
- 00-firstscript.sh
|
||||
- 01-second.sh
|
||||
@@ -40,5 +44,8 @@ One example would be, if you are running craft CMS you'll end up with a repo str
|
||||
|
||||
In this case __WEBROOT__ would be set as __/var/www/html/public__
|
||||
|
||||
### conf
|
||||
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.
|
||||
|
||||
### scripts
|
||||
Scripts are executed in order so its worth numbering them ```00,01,..,99``` to control their run order. Bash scripts are supported but, of course, you could install other run times in the first script then write your scripts in your preferred language.
|
||||
|
||||
Reference in New Issue
Block a user