Skip to content

Commit

Permalink
Version 22.0.0 with Redis support!
Browse files Browse the repository at this point in the history
  • Loading branch information
markshust committed Feb 14, 2019
1 parent f8734fd commit 3aa33aa
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- N/A

## [22.0.0] - 2018-02-14

### Added
- Host bind mount `var/log` folder in `docker-compose.dev.yml` for debugging purposes.
- Redis is now the default storage engine for cache and session. Massively improved performance for local dev! 🚀
- Added commented-out line in `docker-compose.dev.yml` file to easily mount `auth.json` file, with updated usage in README

### Fixed
- Cron not working correctly

## [21.1.2] - 2018-02-04

### Fixed
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ open https://magento2.test
- `bin/magento`: Run the Magento CLI. Ex: `bin/magento cache:flush`
- `bin/node`: Run the node binary. Ex. `bin/node --version`
- `bin/npm`: Run the npm binary. Ex. `bin/npm install`
- `bin/redis`: Run a command from the redis container. Ex `bin/redis redis-cli monitor`
- `bin/remove`: Remove all containers.
- `bin/removevolumes`: Remove all volumes.
- `bin/restart`: Stop and then start all containers.
Expand All @@ -158,11 +159,25 @@ The hostname of each service is the name of the service within the `docker-compo

First setup Magento Marketplace authentication (details in the [DevDocs](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html)).

After doing so, copy `src/auth.json.sample` to `~/.composer/auth.json`. Then update the username and password values with your Magento public and private keys, respectively. The entire `~/.composer` directory is remotely mounted to the container, so Composer will automatically see your keys to authenticate.
Copy `src/auth.json.sample` to `src/auth.json`. Then, update the username and password values with your Magento public and private keys, respectively. Finally, copy the file to the container by running `bin/copytocontainer auth.json`.

The other option is copy `src/auth.json.sample` to `src/auth.json`. Then, uncomment the following line in `docker-compose.dev.yml` so it reads:
### Redis

`- ./src/auth.json:/var/www/html/auth.json:delegated`
Redis is now the default cache and session storage engine, and is automatically configured & enabled when running `bin/setup` on new installs.

Use the following lines to enable Redis on existing installs:

**Enable for Cache:**

`bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0`

**Enable for Session:**

`bin/magento setup:config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=1`

You may also monitor Redis by running: `bin/redis redis-cli monitor`

For more information about Redis usage with Magento, <a href="https://devdocs.magento.com/guides/v2.3/config-guide/redis/redis-session.html" target="_blank">see the DevDocs</a>.

### Xdebug & VS Code

Expand Down
6 changes: 6 additions & 0 deletions compose/magento-2/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ bin/clinotty bin/magento indexer:reindex
echo "Forcing deploy of static content to speed up initial requests..."
bin/clinotty bin/magento setup:static-content:deploy -f

echo "Enabling redis for cache..."
bin/clinotty bin/magento setup:config:set --no-interaction --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0

echo "Enabling Redis for session..."
bin/clinotty bin/magento setup:config:set --no-interaction --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=1

echo "Clearing the cache for good measure..."
bin/clinotty bin/magento cache:flush

Expand Down
3 changes: 1 addition & 2 deletions compose/magento-2/docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mark Shust's Docker Configuration for Magento (https://github.com/markshust/docker-magento)
# Version 21.1.2
# Version 22.0.0

version: "3"

Expand All @@ -10,7 +10,6 @@ services:
- ./src/app/code:/var/www/html/app/code:delegated
- ./src/app/design:/var/www/html/app/design:delegated
- ./src/app/etc:/var/www/html/app/etc:delegated
#- ./src/auth.json:/var/www/html/auth.json:delegated
- ./src/composer.json:/var/www/html/composer.json:delegated
- ./src/composer.lock:/var/www/html/composer.lock:delegated
- ./src/nginx.conf.sample:/var/www/html/nginx.conf:delegated
Expand Down
2 changes: 1 addition & 1 deletion compose/magento-2/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mark Shust's Docker Configuration for Magento (https://github.com/markshust/docker-magento)
# Version 21.2.0
# Version 22.0.0

version: "3"

Expand Down

0 comments on commit 3aa33aa

Please sign in to comment.