一、安装装备
apt install make unzip curl git
git clone https://github.com/chevereto/docker.git
二、构建容器映像
主机名创建example
命名空间mywebsite.com
git clone https://github.com/chevereto/docker.git
cd docker
make env 创建 Chevereto 的 .env 配置文件,并根据提示输入相关配置
make image 构建 Chevereto
生成4个版本映像
chevereto:latest
chevereto:4
chevereto:4.0
chevereto:4.2.5
三、部署 chevereto
部署新网站
make deploy NAMESPACE={子域名} ADMIN_EMAIL={管理员邮箱}
Docker-compose.yml方式
services:
chevereto:
image: chevereto:4.2.5
container_name: chevereto
restart: always
ports:
- "8080:80"
environment:
- CHEVERETO_LICENSE_KEY=${CHEVERETO_LICENSE_KEY}
- DOMAIN=${DOMAIN}
- CHEVERETO_DB_HOST=127.0.0.1 # 或者使用 localhost
- CHEVERETO_DB_NAME=chevereto # 设置为你在宝塔中创建的数据库名称
- CHEVERETO_DB_USER=chevereto # 设置为你在宝塔中创建的数据库用户名
- CHEVERETO_DB_PREFIX=chv_
- CHEVERETO_DB_PASS=chv123456 # 设置为你在宝塔中设置的数据库密码
volumes:
- /data/web/html/chevereto/images:/var/www/html/images:rw
四、更新映像
同步仓库
make sync
切换新分支
git switch 4.2
重新构建容器镜像
make image
更新 Chevereto
make update