免费注册Amazon云服务器!并搭建网站、博客等

Admin 2023-12-27 631 12/27

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 -
最后修改:2023年12月27日

非特殊说明,本博所有文章均为博主原创。