配置文件
docker-compose.yml
配置内容
mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=wordpress
web:
image: wordpress
links:
- mysql
environment:
- WORDPRESS_DB_USER=root
- WORDPRESS_DB_PASSWORD=123456
ports:
- "8585:80"
working_dir: /var/www/html
volumes:
- /d/docker/docker-demo/my-volume:/var/www/html
启动
$ docker-compose up
关闭
$ docker-compose stop
删除
$ docker-compose rm