使用 docker-compose 根据 官方教程 配合 wordpress docker 搭起了 wordpress,配置文件如下:
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
我把模板挂载到容器对应的目录里了:
volumes:
- "./wp-content/themes:/var/www/html/wp-content/themes"
现在的问题是,每次修改模板的内容,刷新页面并不会显示修改后的结果,得用 docker-compose restart
后才能查看修改后的结果,请问是不是我哪里配置错了?
版本 docker for mac Version 1.12.0 (build: 10871)
초기화 중에
으아아아volumes
이 구성에 추가되지 않은 문제를 찾았습니다. 나중에 새 마운트 디렉터리를 추가하는 경우 다음과 같이 원래 컨테이너를 삭제한 후 다시 만들어야 합니다.출처 https://www.digitalocean.com/...