Skip to content

Commit

Permalink
Added ENV to set Redis maxmemory
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuechner committed Nov 30, 2021
1 parent 323b17b commit 0c4e497
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Please also see [web/sites/default/settings.php](web/sites/default/settings.php)
| UPDATEDB_ON_STARTUP | If set to `yes`, `drush updatedb` will be executed once on container start. Default: `no` | `yes`or `no` |
| CACHEREBUILD_ON_STARTUP | If set to `yes`, `drush cache-rebuild` will be executed once on container start. Default: `no` | `yes`or `no` |
| USE_REDIS | Use Redis as memory cache. Default: `no` | `yes`or `no` |
| REDIS_MAXMEMORY | Set a memory usage limit for Redis to the specified amount of bytes. Default: `1gb` | `1gb` or `100mb` |

### Build and start Docker container locally

Expand Down
4 changes: 4 additions & 0 deletions scripts/docker-php-entrypoint-drupal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set +e;

HTPASSWD_GREETING="${HTPASSWD_GREETING:-Sie greifen auf ein Testsystem der DDB zu. Bitte geben als Benutzer 'testsystem' und als Passwort ebenfalls 'testsystem' ein.}";
REDIS_MAXMEMORY="${REDIS_MAXMEMORY:-1gb}";
# HTPASSWD_USER -> HTTP Basic Auth User
# HTPASSWD_PWD -> HTTP Basic Auth Password

Expand All @@ -26,6 +27,9 @@ else
} > /etc/nginx/auth.conf;
fi;

/usr/bin/redis-cli config set maxmemory "${REDIS_MAXMEMORY}";
/usr/bin/redis-cli config set maxmemory-policy volatile-lru;

set -e;

docker-php-entrypoint;
Expand Down

0 comments on commit 0c4e497

Please sign in to comment.