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
+25-10
Original file line number
Diff line number
Diff line change
@@ -12,19 +12,19 @@ Docker running Nginx, PHP-FPM, Composer, MySQL and PHPMyAdmin.
12
12
13
13
We’ll download the code from its repository on GitHub.
14
14
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]
16
16
17
17
We'll generate and configure SSL certificate for nginx before running server.
18
18
19
-
4.[Configure Xdebug](#configure-xdebug)
19
+
4.[Configure Xdebug](#configure-xdebug)[Optional]
20
20
21
21
We'll configure Xdebug for IDE (PHPStorm or Netbeans).
22
22
23
23
5.[Run the application](#run-the-application)
24
24
25
25
By this point we’ll have all the project pieces in place.
26
26
27
-
6.[Use Makefile](#use-makefile)
27
+
6.[Use Makefile](#use-makefile)[Optional]
28
28
29
29
When developing, you can use `Makefile` for doing recurrent operations.
30
30
@@ -36,7 +36,7 @@ ___
36
36
37
37
## Install prerequisites
38
38
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.
40
40
41
41
All requisites should be available for your distribution. The most important are :
42
42
@@ -50,6 +50,10 @@ Check if `docker-compose` is already installed by entering the following command
50
50
which docker-compose
51
51
```
52
52
53
+
Check Docker Compose compatibility :
54
+
55
+
-[Compose file version 3 reference](https://docs.docker.com/compose/compose-file/)
56
+
53
57
The following is optional but makes life more enjoyable :
54
58
55
59
```sh
@@ -108,15 +112,18 @@ cd docker-nginx-php-mysql
108
112
│ └── db
109
113
│ ├── dumps
110
114
│ └── mysql
115
+
├── doc
111
116
├── docker-compose.yml
112
117
├── etc
113
118
│ ├── nginx
114
-
│ │ └── default.conf
119
+
│ │ ├── default.conf
120
+
│ │ └── default.template.conf
115
121
│ ├── php
116
122
│ │ └── php.ini
117
123
│ └── ssl
118
124
└── web
119
125
├── app
126
+
│ ├── composer.json
120
127
│ ├── composer.json.dist
121
128
│ ├── phpunit.xml.dist
122
129
│ ├── src
@@ -132,21 +139,28 @@ cd docker-nginx-php-mysql
132
139
133
140
## Configure Nginx With SSL Certificates
134
141
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
+
135
146
1. Generate SSL certificates
136
147
137
148
```sh
138
-
sudo docker run --rm -v $(pwd)/etc/ssl:/certificates -e "SERVER=localhost" jacoelho/generate-certificate
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 :
144
157
145
158
```sh
146
159
# server {
147
-
# server_name localhost;
160
+
# server_name ${NGINX_HOST};
148
161
#
149
162
# listen 443 ssl;
163
+
# fastcgi_param HTTPS on;
150
164
# ...
151
165
# }
152
166
```
@@ -155,7 +169,9 @@ cd docker-nginx-php-mysql
155
169
156
170
## Configure Xdebug
157
171
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).
159
175
160
176
1. Get your own local IP address :
161
177
@@ -170,7 +186,6 @@ If you use another IDE than PHPStorm or Netbeans, go to the [remote debugging](h
0 commit comments