whennemuth / bu-wp-docker

This repository comprises two docker build contexts for producing a final docker image for running containers that host BU wordpress websites.
0 stars 0 forks source link

Handle redis setup in the entrypoint #22

Closed jdub233 closed 5 months ago

jdub233 commented 6 months ago

This bash script addition looks for the REDIS_HOST and REDIS_PORT environment variables in the container. If they are present, it adds them to the wp-config.php in the form that the redis-cache plugin expects. It uses the wp-cli wp config command to alter the existing wp-config.php file.

It also checks for the existence of the redis-cache plugin. If present, the script activates it and uses the wp-cli interface of the plugin to create the object-cache.php file to enable the WordPress object cache.

If the environment variables and the plugin are not available, it will skip the cache setup.