This docker-scripts demonstrates usage of Drupal Redis module with Redis docker-scripts container
This is based on original docker-scripts dbox container (https://github.com/docker-scripts/dbox)
settings.sh
has optionalREDIS_HOST
variable to specify Redis server hostname.- By default the value is
redis
- By default the value is
install/redis-config.sh
is injected duringds config
- If
REDIS_HOST
has a value (Redis server hostname), the script installs and configures Drupal to use Redis with said Redis server.
- If
-
Install Docker: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository
-
Install
ds
,wsproxy
andmariadb
: -
Install
redis
- https://github.com/docker-scripts/redis#installation
- This container sets its hostname as
redis
by default. Hence no need to update itssettings.sh
.
-
Clone this repo to
opt/docker-scripts/myproject
like this:
git clone https://github.com/radzaeem/myproject /opt/docker-scripts/myproject
-
Create a directory for the container:
ds init myproject/ds @proj-example-org
-
cd
to project directory
cd /var/ds/proj-example-org/
- Optional: Fix the settings if needed
vim settings.sh
- Build image, create the container and configure it:
ds build
ds create
ds make
-
If the domain is not a real one, add to
/etc/hosts
the line127.0.0.1 proj.example.org
and then try https://proj.example.org in browser. -
If you already have the domain, tell
wsproxy
to manage the domain of this container:ds wsproxy add
-
Tell
wsproxy
to get a free letsencrypt.org SSL certificate for this domain (if it is a real one):ds wsproxy ssl-cert --test ds wsproxy ssl-cert
Check whether Redis server's keys
named cache_boot
is actually used by Drupal.
# hostname of Redis server is 'redis'
cd /var/ds/proj-example-org
ds shell
redis-cli -h redis
keys *cache_boot*
exit
Example output
(proj-example-org)root@proj-example-org:/var/www
==> # redis-cli -h redis
redis:6379> keys *cache_boot*
1) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:system_list"
2) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:bootstrap_modules"
3) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:module_implements"
4) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:lookup_cache"
5) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:_last_flush"
6) "3830eb70bda1d214ee12d28fbb4d30e1:cache_bootstrap:hook_info"
Other commands are same as the original dbox
container (https://github.com/docker-scripts/dbox)
ds help
ds shell
ds stop
ds start
ds snapshot
ds inject set-adminpass.sh <new-drupal-admin-passwd>
ds inject set-domain.sh <new.domain>
ds inject set-emailsmtp.sh <gmail-user> <gmail-passwd>
ds inject dev/clone.sh test
ds inject dev/clone-del.sh test
ds inject dev/clone.sh 01
ds backup [proj1]
ds restore <backup-file.tgz> [proj1]