Docker – Mounted volumes for themes being picked up but not served
-
Hi all, here’s my situation broken down:
I’m using docker/docker-compose to run two containers, one for wordpress (using the official wordpress image) and the other for a mysql database.
In my
docker-compose.yml
file I’m mounting my local themes folder into the container’s themes folder like so:wordpress: - volumes: - ./wp-content/themes:/var/www/html/wp-content/themes
The idea here is that I can run my container to test my site in the environment it will be deployed in, but have fast development using volumes (so I don’t have to constantly rebuild the image–this is for development only).
At this point, what I’m trying to do is a proof-of-concept, so I’m using the ‘nearnothing’ theme for as little complexity as possible.
So I run my container using
docker-compose up
, and sure enough the volume is being mounted properly. Changes in my localwp-content/themes
folder immediately propagate to my container’s/var/www/html/wp-content/themes
folder.The problem, however, is that the changes to the theme are not being served. E.g. I modify my base index.php file to say, “Hello, World!”. I confirm that the container’s theme’s index.php is also updated. To remove the possibility of front-end caching, I use Postman to make a GET request to my site. Sure enough, the change isn’t picked up.
However, after an indiscriminate amount of time (usually anywhere from 10 seconds – 5 minutes), the change is finally served. If I make another change, again I have to wait a certain amount of time before the change is served.
At this point, I thought it might be a plugin. But, the only plugin installed is the akismet spam-catcher plugin. No caching plugins ??
I’m a bit of a newb at WordPress, so is there anything glaringly obvious for why the changes would not be immediately served? Any help is appreciated, thank you.
- The topic ‘Docker – Mounted volumes for themes being picked up but not served’ is closed to new replies.