You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-34Lines changed: 19 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,8 @@
1
-
## Introduction
2
-
This is a Dockerfile to build a container image for nginx and php-fpm, with the ability to pull website code from git. The container also has the ability to update templated files with variables passed to docker in order to update your settings. There is also support for lets encrypt SSL support.
1
+
#docker-nginx-php-git
2
+
Minimal base image for hosting Nginx + PHP-FPM powered websites with Automatic Git Deployment functionalities including Webhooks
3
3
4
-
### Git repository
5
-
The source files for this project can be found here: [https://github.com/ngineered/nginx-php-fpm](https://github.com/ngineered/nginx-php-fpm)
4
+
## Configuration
6
5
7
-
If you have any improvements please submit a pull request.
8
-
### Docker hub repository
9
-
The Docker hub build can be found here: [https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/](https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/)
10
-
## Versions
11
-
| Tag | Nginx | PHP | Alpine |
12
-
|-----|-------|-----|--------|
13
-
| latest | 1.10.1 | 5.6.23 | 3.4 |
14
-
| php5 | 1.10.1 | 5.6.23 | 3.4 |
15
-
| php7 | 1.10.1 | 7.0.8 | 3.4 |
16
-
17
-
## Building from source
18
-
To build from source you need to clone the git repo and run docker build:
Pull the image from docker hub rather than downloading the git repo. This prevents you having to build the image on every docker host:
26
-
```
27
-
docker pull richarvey/nginx-php-fpm:latest
28
-
```
29
-
30
-
## Running
31
-
To simply run the container:
32
-
```
33
-
sudo docker run -d richarvey/nginx-php-fpm
34
-
```
35
-
36
-
You can then browse to ```http://<DOCKER_HOST>:8080``` to view the default install files. To find your ```DOCKER_HOST``` use the ```docker inspect``` to get the IP address.
37
6
### Available Configuration Parameters
38
7
39
8
The following flags are a list of all the currently supported options that can be changed by passing in the variables to docker with the -e flag.
@@ -51,6 +20,8 @@ The following flags are a list of all the currently supported options that can b
51
20
-**PHP_POST_MAX_SIZE** : Set a larger post_max_size, default is 100 Mb
52
21
-**PHP_UPLOAD_MAX_FILESIZE** : Set a larger upload_max_filesize, default is 100 Mb
53
22
-**DOMAIN** : Set domain name for Lets Encrypt scripts
23
+
-**GIT_HOOK_TOKEN** : Auth-Token used for the [docker-hook](https://github.com/schickling/docker-hook) listener
24
+
54
25
55
26
### Dynamically Pulling code from git
56
27
One of the nice features of this container is its ability to pull code from a git repository with a couple of environmental variables passed at run time.
You'll need some extra ENV vars to enable this feature. These are ```GIT_EMAIL``` and ```GIT_NAME```. This allows git to be set up correctly and allow the following commands to work.
63
+
64
+
### docker-hook - Git Webhook
65
+
66
+
`docker-hook` is preconfigured to listen to incoming HTTP requests on port 8555
67
+
68
+
All you have to do is setup the **GIT_HOOK_TOKEN** env var, and any requests to `http://yourdomain:8555/<GIT_HOOK_TOKEN>` will trigger a Git pull
69
+
70
+
More info on how it works here: [schickling/docker-hook](https://github.com/schickling/docker-hook)
71
+
92
72
### Push code to Git
93
73
To push code changes made within the container back to git simply run:
94
74
```
@@ -136,3 +116,8 @@ All logs should now print out in stdout/stderr and are available via the docker
136
116
```
137
117
docker logs <CONTAINER_NAME>
138
118
```
119
+
120
+
## Thanks to
121
+
*[ngineered/nginx-php-fpm](https://github.com/ngineered/nginx-php-fpm) - Base Docker image and Git push/pull functionalities
0 commit comments