Skip to content

Commit

Permalink
Add Redis support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobatty committed Oct 18, 2017
1 parent d036aa9 commit 588dae2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
10 changes: 9 additions & 1 deletion 7.0-cli/bin/magento-installer
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ if [ ! "$M2SETUP_INSTALL_DB" = "false" ]; then
fi

$INSTALL_COMMAND
$MAGENTO_COMMAND setup:config:set -n \
--cache-backend=$M2SETUP_REDIS_HOST \
--cache-backend-redis-server=$M2SETUP_REDIS_HOST \
--session-save=$M2SETUP_REDIS_HOST \
--session-save-redis-host=$M2SETUP_REDIS_HOST
$MAGENTO_COMMAND index:reindex
$MAGENTO_COMMAND setup:static-content:deploy

if [ "MAGENTO_RUN_MODE" = "production" ]; then
$MAGENTO_COMMAND setup:static-content:deploy
fi

else
echo "Skipping DB installation"
Expand Down
10 changes: 9 additions & 1 deletion 7.1-cli/bin/magento-installer
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ if [ ! "$M2SETUP_INSTALL_DB" = "false" ]; then
fi

$INSTALL_COMMAND
$MAGENTO_COMMAND setup:config:set -n \
--cache-backend=$M2SETUP_REDIS_HOST \
--cache-backend-redis-server=$M2SETUP_REDIS_HOST \
--session-save=$M2SETUP_REDIS_HOST \
--session-save-redis-host=$M2SETUP_REDIS_HOST
$MAGENTO_COMMAND index:reindex
$MAGENTO_COMMAND setup:static-content:deploy

if [ "MAGENTO_RUN_MODE" = "production" ]; then
$MAGENTO_COMMAND setup:static-content:deploy
fi

else
echo "Skipping DB installation"
Expand Down
9 changes: 9 additions & 0 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- 9000
links:
- db
- redis
volumes_from:
- appdata
env_file:
Expand All @@ -54,12 +55,18 @@ services:
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2

redis:
image: redis:4
ports:
- 6379

cli:
hostname: cli.magento2.docker
build:
context: 7.1-cli/
links:
- db
- redis
volumes:
- ~/.composer/cache:/root/.composer/cache
volumes_from:
Expand All @@ -82,6 +89,7 @@ services:
- M2SETUP_ADMIN_USER=admin
- M2SETUP_ADMIN_PASSWORD=password1
- M2SETUP_VERSION=2.2.*
- M2SETUP_REDIS_HOST=redis
# - M2SETUP_USE_SAMPLE_DATA=true

cron:
Expand All @@ -97,6 +105,7 @@ services:
- appdata
links:
- db
- redis

appdata:
image: tianon/true
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
- 9000
links:
- db
- redis
volumes_from:
- appdata
env_file:
Expand All @@ -51,11 +52,17 @@ services:
- MYSQL_USER=magento2
- MYSQL_PASSWORD=magento2

redis:
image: redis:4
ports:
- 6379

cli:
hostname: cli.magento2.docker
image: meanbee/magento2-php:7.1-cli
links:
- db
- redis
volumes:
- ~/.composer/cache:/root/.composer/cache
volumes_from:
Expand All @@ -78,6 +85,7 @@ services:
- M2SETUP_ADMIN_USER=admin
- M2SETUP_ADMIN_PASSWORD=password1
- M2SETUP_VERSION=2.2.*
- M2SETUP_REDIS_HOST=redis
# - M2SETUP_USE_SAMPLE_DATA=true

cron:
Expand All @@ -92,6 +100,7 @@ services:
- appdata
links:
- db
- redis

appdata:
image: tianon/true
Expand Down

0 comments on commit 588dae2

Please sign in to comment.