1.Amazon免费注册链接:【点击前往】
2.安装docker :
curl -fsSL https://get.docker.com | sh
3.安装docker-compose:
sudo apt-get install composer
4.创建wordpress文件夹并进入
mkdir wordpress cd wordpress
5.创建docker-compose.yml配置文件
touch docker-compose.yml nano docker-compose.yml
6.在里面输入以下内容:
version: "3.3" services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest volumes: - wordpress_data:/var/www/html ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_DB_NAME: wordpress volumes: db_data: {} wordpress_data: {}
7.最后启动一键安装命令:
docker-compose up -d
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END