• 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 local wp-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.

Viewing 1 replies (of 1 total)
  • Hey There,

    Did you ever make any progress on this? I’ve been experiementing with docker-compose and setting up a decent local WP environment, but not experiencing anything like this. What OS are you running? can you share more info on you base container? – maybe your compose file? Are you running the latt Docker distribution for your OS ?

    you can have a look at my code here https://github.com/Pushplaybang/wordpress-docker-local-environment , its really a prototype for now, but my reload times with mounted volumes are instant,

    If you can give me a bit more info, I’ll try to help.

Viewing 1 replies (of 1 total)
  • The topic ‘Docker – Mounted volumes for themes being picked up but not served’ is closed to new replies.