I attempted to set up a simple WordPress development environment with Docker. The problem is that it takes ages for Docker to pick up changes in the local files that are mounted into the container - it’s like 10 or more seconds until the change is recorded by the container. This is my docker-compose.yml:
wordpress:¬ image: wordpress¬ links:¬ - wordpressdb:mysql¬ ports:¬ - 8080:80¬ volumes:¬ - ~/dev/docker/wp/src:/var/www/html¬ wordpressdb:¬ image: mariadb¬ environment:¬ MYSQL_ROOT_PASSWORD: pass phpmyadmin:¬ image: corbinu/docker-phpmyadmin¬ links:¬ - wordpressdb:mysql¬ ports:¬ - 8181:80¬ environment:¬ MYSQL_USERNAME: usr¬ MYSQL_ROOT_PASSWORD: pass
Perhaps I did something wrong with volumes?
I’ve used the official WordPress image. The image comes with a WordPress installation inside so in the
volumes key, I’ve just mapped the directory in the container with my local directory so that I can introduce changes to code. Unfortunately, delays that I’m experiencing with Docker (until it picks up local changes) are not tolerable. It makes the whole setup essentially unusable. Why is that happening?