@@ -132,29 +132,31 @@ You can check what containers exist using
132
132
133
133
docker ps -a
134
134
135
- To get a bash prompt inside the web container, use
135
+ To get a bash prompt inside the a container, use
136
136
137
137
docker-compose exec --user magento2 web bash
138
138
139
- You should see a shell prompt of ` m2$ ` . If you are using a Git Bash window on
140
- Windows, you may see an error message saying you need to use ` winpty ` . In that
141
- case you must use the following command to create a bash prompt.
139
+ This example specified the 'web' service container (see ` docker-compose.yml `
140
+ for the other service names). You should see a shell prompt of ` m2$ ` . If you
141
+ are using a Git Bash window on Windows, you may see an error message saying you
142
+ need to use ` winpty ` . In that case you must use the following command.
142
143
143
144
winpty docker-compose exec --user magento2 web bash
144
145
145
146
In general this works well, but on Windows the 'exec' command will exit if you
146
147
press CTRL+Z. If you like using CTRL+Z in Linux, this is rather annoying, so
147
- SSH access is recommended instead.
148
+ SSH access is recommended instead. SSH is currently only supported in the 'web'
149
+ service container.
148
150
149
- To enable SSH support (recommended), make sure port 22 is uncommented in
150
- ` docker-compose.yml ` and mapped to an available port number. For example, use
151
- "2222:22" to use port 2222 to avoid colliding with any local SSH daemons.
152
- You must then use the ` -p 2222 ` argument to specify the port number. The
153
- ` m2ssh ` command (BAT and bash versions available) automatically picks up the
154
- port number from your ` docker-compose.yml ` file.
151
+ The ` m2ssh ` BAT and bash scripts automatically pick up the port number from the
152
+ ` docker-compose.yml ` file and logs on to the 'magento2' account.
155
153
156
154
m2ssh
157
155
156
+ If you are running Docker in VirtualBox, you may need to edit the local ` m2ssh `
157
+ and ` m2unison ` scripts to replace "localhost" with the IP address allocated by
158
+ VirtualBox.
159
+
158
160
### 4. Install Magento
159
161
160
162
Next you need to install your Magento project inside the web container under
@@ -174,8 +176,9 @@ to help restrict access to the download keys.
174
176
175
177
If you have an existing project with all the source code already under
176
178
` shared/www ` on your laptop, no additional configuration is needed. If you use
177
- volume mounting, the code will automatically be visible; if you use Unison, it
178
- will copy files on your laptop into the web container when Unison is started.
179
+ volume mounting, the code will automatically be visible; if you use Unison,
180
+ Unison will copy files on your laptop into the web container when it is
181
+ started.
179
182
180
183
** Creating a New Project with Composer**
181
184
@@ -347,11 +350,13 @@ work on the project without Unison running to avoid merge conflicts (rare).
347
350
Cron is disabled by default. Running cron may result in faster draining of
348
351
laptop batteries. To manually trigger background index updates, run `magento
349
352
cron: run ` twice in a row (sometimes the first cron schedules jobs for the
350
- second cron to run)
353
+ second cron to run).
351
354
352
355
magento cron:run
353
356
magento cron:run
354
357
358
+ TODO: VERIFY TWO RUNS ARE NEEDED FIRST TIME ONLY. IF SO, CAN SIMPLIFY HERE.
359
+
355
360
To enable cron permanently run the following shell script.
356
361
357
362
cron-install
@@ -387,30 +392,51 @@ TODO: Script? SSH and Remote Interpreters?
387
392
388
393
### 11. Varnish Configuration
389
394
395
+ TODO: THIS SECTION IS NOT COMPLETE.
396
+
390
397
Varnish is a "HTTP accelerator" that sits in front the web server and caches
391
398
content of HTTP responses. It is recommended to use Varnish during development
392
399
to help identify caching issues as early as possible.
393
400
394
401
To enable Varnish, run the following command. This updates configuration
395
402
settings in the database.
396
403
397
- TODO: IS THIS STILL THE RIGHT WAY? OR SHOULD FOR 2.2 ONWARDS IT BE USING
398
- CONFIG SET CLI COMMANDS WITH APP:CONFIG: DUMP ETC. TO MOVE SETTINGS FROM
399
- ENV.PHP TO CONFIG.PHP ETC?
404
+ TODO: NEED TO TRY THIS OUT AND TEST WITH VARNISH CONTAINER ETC.
400
405
401
406
varnish-install
407
+ # magento config:set --scope=default --scope-code=0 system/full_page_cache/caching_application 2
402
408
403
409
To connect via your web browser to Varnish, you must use the Varnish port
404
410
number instead of the web server port number. To determine the Varnish port
405
411
number, use
406
412
407
- TODO: WHY 6081? WHY NOT PORT 80?
413
+ TODO: WHY 6081? WHY NOT PORT 80? DEVDOCS MENTIONED PORT 6082 AS WELL.
408
414
409
415
docker-compose port varnish 6081
410
416
411
417
### 12. Redis Configuration
412
418
413
- TODO: SHOULD REDIS BE CONFIGURED USING CLI COMMANDS NOW? ENV.PHP ETC?
419
+ Uncomment the Redis service in the ` docker-compose.yml ` if you wish to use
420
+ Redis during development, keeping your local development environment closer to
421
+ your production setup. Redis is recommended if you have a cluster of web
422
+ servers in production as an efficient way to share state (such as current
423
+ session information) between them.
424
+
425
+ The Magento DevDocs site (http://devdocs.magento.com/ ) describes how to
426
+ configuration Redis. The following instructions summarize the steps for
427
+ Magento 2.2 onwards.
428
+
429
+ To turn on usage of Redis for session caching, run
430
+
431
+ magento setup:config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=3 --session-save-redis-timeout=10
432
+
433
+ To turn on usage of Redis for default data caching, run
434
+
435
+ magento setup:config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=1
436
+
437
+ To turn on usage of Redis for page caching (not needed if using Varnish), run
438
+
439
+ magento setup:config:set --page-cache=redis --page-cache-redis-server=redis --page-cache-redis-db=2
414
440
415
441
### 13. Grunt and Gulp Configuration
416
442
0 commit comments