@@ -89,11 +89,6 @@ GitHub repository to the project directory.
89
89
Review the ` docker-compose.yml ` file in a text editor, making necessary
90
90
adjustments as described by comments in the file. This includes:
91
91
92
- * You MUST ensure the container names are different per project to avoid
93
- conflicts. For example, the default web service container name is
94
- "proj1-m2web" and the default db service container name is "proj1-m2db".
95
- Change all occurrences of "proj1" to your project name.
96
-
97
92
* To enable volume mounting for the Magento source code (e.g. for Linux
98
93
laptops), uncomment the volume mount line for ` /var/www ` in the provided
99
94
` docker-compose.yml ` file. For Unison (e.g. for Mac and Windows), ensure the
@@ -311,33 +306,25 @@ If you are using Unison for file syncing, you also need to start up a Unison
311
306
process (and keep it running). It is generally recommended to start this up
312
307
after you have installed Magento above.
313
308
314
- On Windows, get a compatible version of the Unison binaries for Windows
315
- from inside the container using the following (adjust "proj1-m2web" to match
316
- your web service container name from the ` docker-compose.yml ` file).
317
-
318
- docker cp proj1-m2web:/windows/unison.exe .
319
- docker cp proj1-m2web:/windows/unison-fsmonitor.exe .
320
-
321
- Then run the supplied BAT file to launch Unison in a separate window using the
322
- START command or by double clicking the BAT file via Windows explorer. Close
323
- the window to kill Unison.
309
+ On Windows, run the supplied BAT file to launch Unison in a separate window
310
+ using the START command or by double clicking the BAT file via Windows
311
+ explorer. This will automatically retrieve a copy of the ` unison.exe ` binary
312
+ from the web container. Close the window to kill Unison.
324
313
325
314
START m2devbox-unison-sync.bat
326
315
327
- Each time you log in, make sure you restart this process, but be careful to not
328
- have multiple copies running in parallel. It is not recommended to do
329
- significant work on the project without Unison running to avoid merge conflicts
330
- (rare).
331
-
332
- Mac binaries and a shell script are also provided:
316
+ Mac binaries and a shell script are also provided. It is recommended to run the
317
+ sync shell script in a separate Terminal window so you can look at its output
318
+ if you ever need to do troubleshooting.
333
319
334
- docker cp proj1-m2web:/macos/unison .
335
- docker cp proj1-m2web:/macos/unison-fsmonitor .
336
- chmod +x unison unison-fsmonitor
320
+ ./m2devbox-unison-sync.sh
337
321
338
- It is recommended to run the sync shell script in a separat Terminal window.
322
+ This shell script cannot be used on Linux, only Mac OSX. Use volume mounting on
323
+ Linux (not Unison).
339
324
340
- ./m2devbox-unison-sync.sh
325
+ Each time you log in, make sure you restart Unison, but be careful to not have
326
+ multiple copies running in parallel. It is not recommended to do significant
327
+ work on the project without Unison running to avoid merge conflicts (rare).
341
328
342
329
### 9. Cron
343
330
391
378
392
379
Grunt and Gulp are both frontend tool chains to speed up frontend development.
393
380
They can both auto-recompile CSS files as soon as a file is written to disk.
394
- NodeJS is preinstalled in the web service container for use by Grunt and Gulp.
381
+ NodeJS is preinstalled in the web service container for use by Grunt and Gulp,
382
+ along with grunt-cli, gulp-cli, and browsersync.
395
383
396
384
To enable Grunt support, run the following commands
397
385
@@ -400,27 +388,18 @@ To enable Grunt support, run the following commands
400
388
cp package.json.sample package.json
401
389
npm install
402
390
grunt refresh --force
391
+ grunt watch
403
392
404
393
For further details, please refer to the Grunt section in the "Frontend
405
394
Developer Guide" on http://devdocs.magento/com .
406
395
407
- Magento does not ship with default Gulp support, but there is the excellent
408
- "frontools" community project based on Gulp. Frontools can be found at
409
- https://github.com/SnowdogApps/magento2-frontools . Version 0.11.4 was the last
410
- version with Less support (as supported by Magento). Frontools provides Sass
411
- replacements for the blank theme that they now support.
412
-
413
- If frontools is not suitable, there are numerous other articles on the web
414
- explaining how to set up Gulp support such as
415
- https://alankent.me/2016/01/27/gulp-et-al-in-magento-2/ . Magento provides a
416
- ` magento dev:source-theme:deploy ` command that resolves all of the Magento file
417
- fallback rules, allowing Gulp or other similar pipelines to be run on the
418
- resultant directory tree.
419
-
420
- If you wish to run BrowserSync with Gulp (https://www.browsersync.io/ ), you
421
- will also need to edit the ` docker-compose.yml ` file to add the BrowserSync
422
- port number to the "ports" list to expose. For this to take effect, you must
423
- rebuild the container which will wipe all the files in the container.
396
+ Magento does not ship with Gulp support, but there are numerous articles on the
397
+ web explaining how to use Gulp with Magento 2, such as
398
+ https://alankent.me/2016/01/27/gulp-et-al-in-magento-2/ .
399
+
400
+ If you wish to run BrowserSync (https://www.browsersync.io/ ), with Gulp you
401
+ need to ensure the BrowserSync ports (3000 and 3001) are left uncommented in
402
+ the ` docker-compose.yml ` file.
424
403
425
404
# Tips and Tricks
426
405
0 commit comments