diff --git a/README.md b/README.md index 98016b6..441cc64 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Pull the image from the docker index rather than downloading the git repo. This ```bash docker pull richarvey/nginx-pfp-fpm:latest ``` -#Running +# Running To simply run the container: ```bash @@ -18,13 +18,13 @@ sudo docker run --name nginx -p 8080:80 -d richarvey/nginx-php-fpm ``` You can then browse to http://:8080 to view the default install files. -##Volumes +## Volumes If you want to link to your web site directory on the docker host to the container run: ```bash sudo docker run --name nginx -p 8080:80 -v /your_code_directory:/usr/share/nginx/html -d richarvey/nginx-php-fpm ``` -##Pulling code from git +## Pulling code from git One of the nice featires of this container is its ability to pull code from a git repository with a couple of enviromental variables passed at run time. **Note:** You need to have your SSH key that you use with git to enable the deployment. I recommend using a special deploy key per project to minimise the risk. @@ -39,7 +39,7 @@ To pull a repository and specify a branch add the GIT_BRANCH environment variabl ```bash sudo docker run -e 'GIT_REPO=git@git.ngd.io:ngineered/ngineered-website.git' -e 'GIT_BRANCH=stage' -v /opt/ngddeploy/:/root/.ssh -p 8080:80 -d richarvey/nginx-php-fpm ``` -##Linking +## Linking Linking to containers also exposes the linked container environment variables which is useful for configuring web apps: Run MySQL container with some extra details: @@ -68,10 +68,9 @@ To link the container launch like this: ```bash sudo docker run -e 'GIT_REPO=git@git.ngd.io:ngineered/ngineered-website.git' -v /opt/ngddeploy/:/root/.ssh -p 8080:80 --link some-mysql:mysql -d richarvey/nginx-php-fpm ``` +# Special Features -#Special Features - -##Templating +## Templating This container will automatically configure your web application if you template your code. For example if you are linking to MySQL like above, and you have a config.php file where you need to set the MySQL details include $$_MYSQL_ENV_MYSQL_DATABASE_$$ style template tags. Example: ```php @@ -81,8 +80,7 @@ database_host = $$_MYSQL_PORT_3306_TCP_ADDR_$$; ... ?> ``` - -##Using environment variables +## Using environment variables If you want to link to an external MySQL DB and not using linking you can pass variables directly to the container that will be automatically configured by the container. Example: @@ -109,5 +107,5 @@ database_pass = $$_MYSQL_PASS_$$ ?> ``` -##Template anything +## Template anything Yes ***ANYTHING***, any variable exposed by a linked container or the **-e** flag lets you template your config files. This means you can add redis, mariaDB, memcache or anything you want to your application very easily. \ No newline at end of file