WordPress official docker, why can not edit files automatically be synchronized to the container
Use docker-compose according to the official tutorial with wordpress docker put up the wordpress, the configuration file is as follows:
version: '2' services: db: image: mysql:5.6 volumes: - "./.data/db:/var/lib/mysql" restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest links: - db ports: - "8000:80" volumes: - "./wp-content/themes:/var/www/html/wp-content/themes" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress
I mount the template in the container's corresponding directory:
volumes: - "./wp-content/themes:/var/www/html/wp-content/themes"
The question now is that each time you modify the contents of the template, refresh the page and will not show the results of the
docker-compose restart can be used to see the revised results, is not where I configured wrong?
Version docker for mac Version 1.12.0 (build: 10871)
One Solution collect form web for “WordPress official docker, why can not edit files automatically be synchronized to the container”
Find the solution, the first initialization when the configuration did not add
volumes to mount, if the follow-up to add a new mount directory, you need to delete the original container and then re-create, as follows:
docker-compose rm wordpress docker-compose up -d