@@ -3,6 +3,7 @@ Docker configuration to run a Symfony app.
3
3
## Run
4
4
5
5
docker-compose up -d
6
+ docker-compose exec php composer install
6
7
7
8
You can now visit http://localhost and see the default Symfony page.
8
9
@@ -15,16 +16,43 @@ Symfony commands:
15
16
16
17
## Included stuff
17
18
19
+ ### Nginx
20
+
21
+ The official Nginx image is used with a slight addition for permissions.
22
+
23
+ The virtual host is defined in the [ app.conf] ( docker/nginx/app.conf ) file. This file is shared with the container
24
+ as defined in the ` docker-compose.yml ` file. I prefer to share the host like this instead of using ` COPY ` in the Dockerfile
25
+ as there is no need to build a new image if the host changes. A simple ` docker-compose up -d ` will take
26
+ the new host into account.
27
+
28
+ ### PHP-FPM
29
+
30
+ PHP-FPM 7.0 is installed with the following configuration:
31
+
32
+ * Necessary extensions for Symfony
33
+ * MySQL
34
+ * GD
35
+ * Composer
36
+ * PHPUnit
37
+ * Xdebug
38
+
39
+
18
40
### Xdebug
19
41
20
42
Making Xdebug working with Docker is quite tricky as there is currently a limitation to Docker for Mac
21
43
that prevents a container to make a request to the the host, which is exactly what we would like to do with Xdebug.
22
44
23
- To make Xdebug debugging work, you will first need to run this command:
45
+ To make Xdebug debugging work, you will first need to run this command on the host :
24
46
25
47
sudo ifconfig lo0 alias 10.200.10.1/24
26
48
27
- This IP address is configured in the environment variables of the PHP container (see ` docker-compose.yml ` file).
49
+ This IP address is configured in the environment variables of the PHP container, in the ` docker-compose.yml ` file:
50
+
51
+ services:
52
+ php:
53
+ # ...
54
+ environment:
55
+ XDEBUG_REMOTE_HOST: 10.200.10.1
28
56
29
57
No extra configuration is needed in your IDE (tested on Sublime Text, Visual Studio Code and Atom), apart the usual.
30
58
0 commit comments