docker-compose的方式部署wordpress
- 安装docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
- 编写docker-compose.yml
mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=wordpress
web:
image: wordpress
links:
- mysql
environment:
- WORDPRESS_DB_PASSWORD=123456
ports:
- "0.0.0.0:8080:80"
working_dir: /var/www/html
volumes:
- wordpress:/var/www/html
- 启动docker
sudo systemctl start docker
- 运行docker-compose
docker-compose up
参考:
What does “local address” and “foreign address” mean in the netstat command result?
评论