Skip to content

Commit 60e16d5

Browse files
committed
Update README
1 parent 4ed61dc commit 60e16d5

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

Diff for: README.md

+25-10
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ Docker running Nginx, PHP-FPM, Composer, MySQL and PHPMyAdmin.
1212

1313
We’ll download the code from its repository on GitHub.
1414

15-
3. [Configure Nginx With SSL Certificates](#configure-nginx-with-ssl-certificates)
15+
3. [Configure Nginx With SSL Certificates](#configure-nginx-with-ssl-certificates) [Optional]
1616

1717
We'll generate and configure SSL certificate for nginx before running server.
1818

19-
4. [Configure Xdebug](#configure-xdebug)
19+
4. [Configure Xdebug](#configure-xdebug) [Optional]
2020

2121
We'll configure Xdebug for IDE (PHPStorm or Netbeans).
2222

2323
5. [Run the application](#run-the-application)
2424

2525
By this point we’ll have all the project pieces in place.
2626

27-
6. [Use Makefile](#use-makefile)
27+
6. [Use Makefile](#use-makefile) [Optional]
2828

2929
When developing, you can use `Makefile` for doing recurrent operations.
3030

@@ -36,7 +36,7 @@ ___
3636

3737
## Install prerequisites
3838

39-
For now, this project has been mainly created for Unix `(Linux/MacOS)`. Perhaps it could work on Windows. Make sure to make compatible the relative paths in the `docker-compose.yml` file configuration like `c:\foo\bar`.
39+
For now, this project has been mainly created for Unix `(Linux/MacOS)`. Perhaps it could work on Windows.
4040

4141
All requisites should be available for your distribution. The most important are :
4242

@@ -50,6 +50,10 @@ Check if `docker-compose` is already installed by entering the following command
5050
which docker-compose
5151
```
5252

53+
Check Docker Compose compatibility :
54+
55+
- [Compose file version 3 reference](https://docs.docker.com/compose/compose-file/)
56+
5357
The following is optional but makes life more enjoyable :
5458

5559
```sh
@@ -108,15 +112,18 @@ cd docker-nginx-php-mysql
108112
│ └── db
109113
│ ├── dumps
110114
│ └── mysql
115+
├── doc
111116
├── docker-compose.yml
112117
├── etc
113118
│ ├── nginx
114-
│ │ └── default.conf
119+
│ │ ├── default.conf
120+
│ │ └── default.template.conf
115121
│ ├── php
116122
│ │ └── php.ini
117123
│ └── ssl
118124
└── web
119125
├── app
126+
│ ├── composer.json
120127
│ ├── composer.json.dist
121128
│ ├── phpunit.xml.dist
122129
│ ├── src
@@ -132,21 +139,28 @@ cd docker-nginx-php-mysql
132139

133140
## Configure Nginx With SSL Certificates
134141

142+
You can change the host name by editing the `.env` file.
143+
144+
If you modify the host name, do not forget to add it to the `/etc/hosts` file.
145+
135146
1. Generate SSL certificates
136147

137148
```sh
138-
sudo docker run --rm -v $(pwd)/etc/ssl:/certificates -e "SERVER=localhost" jacoelho/generate-certificate
149+
source .env && sudo docker run --rm -v $(pwd)/etc/ssl:/certificates -e "SERVER=$NGINX_HOST" jacoelho/generate-certificate
139150
```
140151

141152
2. Configure Nginx
142153

143-
Edit nginx file `etc/nginx/default.conf` and uncomment the SSL server section :
154+
Do not modify the `etc/nginx/default.conf` file, it is overwritten by `etc/nginx/default.template.conf`
155+
156+
Edit nginx file `etc/nginx/default.template.conf` and uncomment the SSL server section :
144157

145158
```sh
146159
# server {
147-
# server_name localhost;
160+
# server_name ${NGINX_HOST};
148161
#
149162
# listen 443 ssl;
163+
# fastcgi_param HTTPS on;
150164
# ...
151165
# }
152166
```
@@ -155,7 +169,9 @@ cd docker-nginx-php-mysql
155169

156170
## Configure Xdebug
157171

158-
If you use another IDE than PHPStorm or Netbeans, go to the [remote debugging](https://xdebug.org/docs/remote) section of Xdebug documentation.
172+
If you use another IDE than [PHPStorm](https://www.jetbrains.com/phpstorm/) or [Netbeans](https://netbeans.org/), go to the [remote debugging](https://xdebug.org/docs/remote) section of Xdebug documentation.
173+
174+
For a better integration of Docker to PHPStorm, use the [documentation](https://github.com/nanoninja/docker-nginx-php-mysql/blob/master/doc/phpstorm-macosx.md).
159175

160176
1. Get your own local IP address :
161177

@@ -170,7 +186,6 @@ If you use another IDE than PHPStorm or Netbeans, go to the [remote debugging](h
170186
```sh
171187
xdebug.remote_host=192.168.0.1 # your IP
172188
```
173-
174189
---
175190

176191
## Run the application

0 commit comments

Comments
 (0)