Dimitrios Desyllas Dimitrios Desyllas - 3 months ago 26
PHP Question

How can I test that a docker wordpress-fpm with custom plugins works

I have made The following Dockerfile:

FROM wordpress:fpm

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update &&\
apt-get install -y unzip &&\
rm -rf /var/cache/apt/*

ENV PLUGIN_URL https://downloads.wordpress.org/plugin

ENV PIWIK_PLUGIN_VERSION 1.0.9
RUN curl -o /tmp/wp-piwik.${PIWIK_PLUGIN_VERSION}.zip ${PLUGIN_URL}/wp-piwik.${PIWIK_PLUGIN_VERSION}.zip &&\
unzip /tmp/wp-piwik.${PIWIK_PLUGIN_VERSION}.zip -d /tmp &&\
chown www-data:www-data /tmp/wp-piwik &&\
mv /tmp/wp-piwik /usr/src/wordpress/wp-content/plugins/&&\
find /usr/src/wordpress/wp-content/plugins/wp-piwik -type d -exec chmod 755 {} + &&\
find /usr/src/wordpress/wp-content/plugins/wp-piwik -type d -exec chmod 633 {} + &&\
ls -l /usr/src/wordpress/wp-content/plugins/


But as you can see it runs fpm. Also on my host have installed a lamp stack with php that does NOT run on fpm. So I want my installed apache to be able to connect to my a running fpm container from the above dockerfile.

What I want to achieve it to test that the plugin I installed manually during the build works like a charm.

Answer

In the end I switched this:

FROM wordpress:fpm

Into this:

FROM wordpress

So I can test directly with my browser via docker's port forwarding