- 文件名为docker-compose.yml
version: '2'
services:
db:
image : mysql:5.7
volumes:
- "./.data/db:/var/lib/mysql"
restart : always
environment:
MYSQL_ROOT_PASSWORD :
MYSQL_DATABASE : wordpress
MYSQL_USER : wordpress
MYSQL_PASSWORD :wordpress:
depends_on:
- db
image: wordpress:latest
links:
- db
ports:
- "8000:80"
restart : always
environment:
WORDPRESS_DB_HOST:db : 3306
WORDPRESS_DB_PASSWORD : wordpress
~- docker-compose up -d
- 访问ip:8000
参考
利用docker-compose搭建WorldPress博客系统
发布于 2022-02-22 1747 次阅读
Comments NOTHING