File tree 11 files changed +64
-38
lines changed
11 files changed +64
-38
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,16 @@ and this project adheres to [Semantic Version](http://semver.org/spec/v2.0.0.htm
11
11
12
12
### Removed
13
13
14
- ## [ 1.1] - 18 -08-2018
14
+ ## [ 1.1] - 24 -08-2018
15
15
### Changed
16
16
17
17
* Use ` modestcoders/unison:2.51.2 ` image for unison container
18
18
* Update ` markoshust/magento-php ` images to PHP ` 7.1 ` using tag ` 7.1-fpm-3 `
19
+ * Update docker setup with fixes for node and integration tests
20
+ * Update dependencies and ` app-volumes ` configuration to avoid issues when ` app-volumes ` is started several times in same ` docker-compose up ` execution
21
+ * Execute Dockerfile run commands for ` app-volumes ` in only one layer as it is best practise
22
+ * Update README with ` node ` and ` unison ` commands to use ` run ` instead of ` exec `
23
+ * Update ` xdebug + phpstorm ` documentation
19
24
20
25
## [ 1.0.1] - 15-08-2018
21
26
### Changed
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ There are 2 options to sync the volumes `vendor` and `generated`
99
99
This option must be used most of the times. You should only need to sync ` vendor ` and ` generated ` from time to time for debugging purposes
100
100
101
101
```
102
- docker-compose exec unison sync -path <path_to_sync>
102
+ docker-compose run --rm unison sync -path <path_to_sync>
103
103
```
104
104
105
105
** NOTE:** ` <path_to_sync> ` should be ` vendor ` or ` generated ` . For faster and more specific syncs, you can include the subfolder path inside ` vendor ` like ` sync -path vendor/<company_name> ` .
@@ -109,33 +109,26 @@ docker-compose exec unison sync -path <path_to_sync>
109
109
This option is only recommended if you are implementing code in a vendor module.
110
110
111
111
```
112
- docker-compose exec unison watch -path <path_to_sync>
112
+ docker-compose run --rm unison watch -path <path_to_sync>
113
113
```
114
114
115
- Example: ` docker-compose exec unison watch -path vendor/<company_name>/<module_name> `
115
+ Example: ` docker-compose run --rm unison watch -path vendor/<company_name>/<module_name> `
116
116
117
117
### Frontend
118
118
119
- 1 . Start node container
119
+ 1 . NPM config setup (Only first time)
120
120
121
121
```
122
- docker-compose up node
122
+ docker-compose run --rm node sh -c "cp -n package.json.sample package.json \
123
+ && cp -n Gruntfile.js.sample Gruntfile.js \
124
+ && npm install"
123
125
```
124
126
125
- 2 . NPM config setup (Only first time)
127
+ 2 . Grunt watch
126
128
127
129
```
128
- docker-compose exec node bash
129
- cp package.json.sample package.json && cp Gruntfile.js.sample Gruntfile.js
130
- npm install
131
- ```
132
-
133
- 3 . Grunt watch
134
-
135
- ```
136
- docker-compose exec node bash
137
- grunt exec:<theme>
138
- grunt watch
130
+ docker-compose run --rm node sh "grunt exec:<theme>"
131
+ docker-compose run --rm node sh "grunt watch"
139
132
```
140
133
141
134
## Xdebug
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ RUN mkdir -p /var/www/html/vendor \
4
4
/var/www/html/generated \
5
5
/var/www/html/var \
6
6
/var/www/html/pub/static \
7
- /var/www/html/pub/media
7
+ /var/www/html/pub/media \
8
+ /var/www/html/dev/tests/integration/tmp \
9
+ && chown -R 1000:1000 /var/www/html
8
10
9
- RUN chown -R 1000:1000 /var/www/html/vendor \
10
- /var/www/html/generated \
11
- /var/www/html/var \
12
- /var/www/html/pub/static \
13
- /var/www/html/pub/media
11
+ # Keep container running until all other containers are created.
12
+ # This avoid issues when this container is started multiple times.
13
+ CMD sleep 30
Original file line number Diff line number Diff line change
1
+ FROM modestcoders/node-php:node8-php7.1
2
+
3
+ RUN mkdir -p /home/app \
4
+ && usermod -d /home/app -l app node \
5
+ && chown -R app /home/app
6
+
7
+ USER app
Original file line number Diff line number Diff line change
1
+ FROM markoshust/magento-php:7.1-fpm-3
2
+
3
+ USER root:root
4
+
5
+ RUN apt-get install -y procps
6
+
7
+ USER app:app
Original file line number Diff line number Diff line change @@ -12,27 +12,24 @@ services:
12
12
- app-var:/var/www/html/var
13
13
- pub-static:/var/www/html/pub/static
14
14
- pub-media:/var/www/html/pub/media
15
+ - integration-test-sandbox:/var/www/html/dev/tests/integration/tmp
15
16
16
17
app :
17
18
build : ./config/docker/image/nginx
18
19
ports :
19
20
- 80:8000
20
21
volumes : *appvolumes
21
22
depends_on :
22
- - app-volumes
23
23
- phpfpm
24
- - db
25
- - unison
26
24
27
25
phpfpm :
28
- image : markoshust/magento-php:7.1-fpm-3
26
+ build : ./config/docker/image/phpfpm
29
27
volumes : *appvolumes
30
28
environment :
31
29
PHP_IDE_CONFIG : serverName=localhost
32
30
depends_on :
33
31
- app-volumes
34
32
- db
35
- - unison
36
33
37
34
db :
38
35
image : mysql:5.7
@@ -62,12 +59,12 @@ services:
62
59
privileged : true
63
60
64
61
node :
65
- image : modestcoders/ node-php:node8-php7.1
66
- volumes : *appvolumes
67
- environment :
68
- - NPM_CONFIG_PREFIX=/home/node /.npm-global # To avoid permission error on npm install. It tries to save it at /var/www (root is the owner)
69
- depends_on :
70
- - app
62
+ build : ./config/docker/image/ node
63
+ volumes : *appvolumes
64
+ environment :
65
+ - NPM_CONFIG_PREFIX=/home/app /.npm-global # To avoid permission error on npm install. It tries to save it at /var/www (root is the owner)
66
+ depends_on :
67
+ - app-volumes
71
68
72
69
volumes :
73
70
dbdata :
@@ -77,3 +74,4 @@ volumes:
77
74
app-var :
78
75
pub-static :
79
76
pub-media :
77
+ integration-test-sandbox :
Original file line number Diff line number Diff line change 19
19
* Select `phpfpm` docker image
20
20
21
21

22
-
23
- 3 . ` PHPStorm > Preferences > Languages & Frameworks > PHP > DBGp Proxy `
22
+
23
+ 3 . ` PHPStorm > Preferences > Languages & Frameworks > PHP > Debug `
24
+ * Debug Port: 9001
25
+
26
+ 
27
+
28
+ 4 . ` PHPStorm > Preferences > Languages & Frameworks > PHP > Debug > DBGp Proxy `
24
29
25
30
* Host must match with the `REMOTE_HOST_IP` set on the [Xdebug configuration](xdebug.md)
26
31
27
32

28
33
29
- 4 . ` PHPStorm > Preferences > Languages & Frameworks > PHP > Servers `
34
+ 5 . ` PHPStorm > Preferences > Languages & Frameworks > PHP > Servers `
30
35
31
36
* Name: `localhost` (Same as `PHP_IDE_CONFIG` in `docker-compose.yml`)
32
37
* Port: 8000
33
38
* Mapping: `/Users/<username>/Sites/<project> -> /var/www/html`
34
39
35
40

41
+
42
+ 6 . Start Listening for PHP Debug connections
36
43
44
+ **NOTE**: Be sure to activate that only after setting the right debug port. Changes in Debug port are ignored once the listener has started.
37
45
46
+ 
47
+
38
48
49
+ 7 . Install and enable ` Xdebug helper ` plugin in Chrome
50
+
51
+ * [https://chrome.google.com/webstore/detail/xdebug-helper](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc)
39
52
53
+ 
54
+ 
55
+
40
56
41
57
42
58
You can’t perform that action at this time.
0 commit comments