I'm trying to install the w3-total-cache plugin in a wordpress docker image with the wp-cli, but it seems to try to connect to the database, even tough I don't try to activate it. In the Dockerfile I install other themes/plugins with composer and everything seems fine, but the only package I found for the w3tc plugin is https://packagist.org/packages/finaldream/w3-total-cache that isn't official and also doesn't seem to be up-to-date (version 0.9.4.6 while w3tc is version 0.14.4).
I can install it with the wp-cli in a machine in the final environment because it has the database, but it seems I can't install in a CI environment to create a docker image with pre-installed plugins, and I haven't found other questions and solutions about it.
Is there a way to install the plugin in a CI environment, without a database? (in the final environment, be it dev, staging, or production, I would only call wp-cli to activate the plugins, as I already do for plugins installed with composer).
I ended up considering that the best option in this case is to
curlthe zip file from wordpress (because in the end wordpress plugins are mainly directories inside thepluginsfolder).I added the following instructions in the dockerfile:
Update (2020-08-20)
I did as leymannx suggested in the comments and included a instruction in a post install instruction in the
composer.jsonfile to call a shell script with the following commands:(I also removed those commands from the
Dockerfile)This allowed to make the whole process more transparent for whoever uses this wordpress environment.