Skip to content

Commit 55e8e80

Browse files
author
Alan Kent
committed
Added Redis 2.2 instructions.
Made some other minor tweaks.
1 parent b203039 commit 55e8e80

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

README.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,29 +132,31 @@ You can check what containers exist using
132132

133133
docker ps -a
134134

135-
To get a bash prompt inside the web container, use
135+
To get a bash prompt inside the a container, use
136136

137137
docker-compose exec --user magento2 web bash
138138

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.
142143

143144
winpty docker-compose exec --user magento2 web bash
144145

145146
In general this works well, but on Windows the 'exec' command will exit if you
146147
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.
148150

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.
155153

156154
m2ssh
157155

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+
158160
### 4. Install Magento
159161

160162
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.
174176

175177
If you have an existing project with all the source code already under
176178
`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.
179182

180183
**Creating a New Project with Composer**
181184

@@ -347,11 +350,13 @@ work on the project without Unison running to avoid merge conflicts (rare).
347350
Cron is disabled by default. Running cron may result in faster draining of
348351
laptop batteries. To manually trigger background index updates, run `magento
349352
cron:run` twice in a row (sometimes the first cron schedules jobs for the
350-
second cron to run)
353+
second cron to run).
351354

352355
magento cron:run
353356
magento cron:run
354357

358+
TODO: VERIFY TWO RUNS ARE NEEDED FIRST TIME ONLY. IF SO, CAN SIMPLIFY HERE.
359+
355360
To enable cron permanently run the following shell script.
356361

357362
cron-install
@@ -387,30 +392,51 @@ TODO: Script? SSH and Remote Interpreters?
387392

388393
### 11. Varnish Configuration
389394

395+
TODO: THIS SECTION IS NOT COMPLETE.
396+
390397
Varnish is a "HTTP accelerator" that sits in front the web server and caches
391398
content of HTTP responses. It is recommended to use Varnish during development
392399
to help identify caching issues as early as possible.
393400

394401
To enable Varnish, run the following command. This updates configuration
395402
settings in the database.
396403

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.
400405

401406
varnish-install
407+
# magento config:set --scope=default --scope-code=0 system/full_page_cache/caching_application 2
402408

403409
To connect via your web browser to Varnish, you must use the Varnish port
404410
number instead of the web server port number. To determine the Varnish port
405411
number, use
406412

407-
TODO: WHY 6081? WHY NOT PORT 80?
413+
TODO: WHY 6081? WHY NOT PORT 80? DEVDOCS MENTIONED PORT 6082 AS WELL.
408414

409415
docker-compose port varnish 6081
410416

411417
### 12. Redis Configuration
412418

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
414440

415441
### 13. Grunt and Gulp Configuration
416442

0 commit comments

Comments
 (0)