docs: add docker-compose upgrade method (#65)

* 增加docker-compose安装方式

* 增加docker-compose安装方式的侧边目录

* 根据修改意见进行完善,增加halo+redis+mysql编排

* Update docs/getting-started/install/docker-compose.md

Co-authored-by: John Niang <johnniang@fastmail.com>

* Update docs/getting-started/install/docker-compose.md

Co-authored-by: John Niang <johnniang@fastmail.com>

* Update docs/getting-started/install/docker-compose.md

Co-authored-by: John Niang <johnniang@fastmail.com>

* 解决重复创建./halo目录导致的自定义数据库application.yaml不生效的问题。

解决重复创建./halo目录导致的自定义数据库application.yaml不生效的问题。

* 根据修改建议,调整至其他中

* 将doceker-compose文档移动到other目录下

* 更正调整目录后文档内的引用路径

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update docs/getting-started/install/other/docker-compose.md

Co-authored-by: Ryan Wang <i@ryanc.cc>

* remove environment variable whitespace

* MySQL容器启动时自动初始化DB Schema

* MySQL容器启动时自动初始化DB Schema

* 修改容器重启策略,使用绝对路径映射目录

* 增加docker-compose更新方式

* Modify the suffix spelling of the yaml file

* 调整更新容器组文档位置

* 解决pnpm lint提示的错误

* 解决pnpm lint提示的错误

Co-authored-by: “MoshiCoCo” <“junzhou2016@outlook.com”>
Co-authored-by: John Niang <johnniang@fastmail.com>
Co-authored-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: MoshiCoCo <junzhou2016@outlook.com>
JohnNiang-patch-1
Moshi 3 years ago committed by GitHub
parent c7fcd588f0
commit 4537023e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -229,3 +229,67 @@ reverse_proxy 127.0.0.1:8090
```
以上配置都可以在 <https://github.com/halo-dev/halo-common> 找到。
## 更新容器组
:::info
我们假设您的 Halo 服务容器是按照 [使用 Docker-Compose 部署 Halo](docker-compose.md) 中的方式启动的。如有不同,请根据实际情况修改。
:::
1. 停止运行中的容器
```bash
docker-compose stop
```
:::info
此操作会停止所有使用当前 `docker-compose.yaml` 启动的容器,如果需要单独更新镜像,请参考上文。
:::
2. 备份数据(重要)
```bash
cp -r ~/.halo ~/.halo.archive
```
> 需要注意的是,`.halo.archive` 文件名不一定要根据此文档命名,这里仅仅是个示例。
3. 清空 [leveldb](../../config.md#缓存) 缓存(如果有使用 leveldb 作为缓存策略)
```bash
rm -rf ~/.halo/.leveldb
```
4. 更新 Halo 服务
:::info
注意,当您的 `Docker` 镜像源非官方源时,执行 `docker-compose pull` 命令时可能无法获取到最新的 `latest` 标签的镜像。
:::
针对使用 `latest` 标签镜像的更新:
```bash
docker-compose pull && docker-compose up -d
```
针对使用具体版本标签镜像的更新:
修改 `docker-compose.yaml` 中配置的镜像版本。
```diff
services:
halo_server:
depends_on:
- mysql_db
- redis_db
- image: halohub/halo:1.5.0
+ image: halohub/halo:1.5.1
container_name: halo-self
```
5. 启动容器组:
```bash
docker-compose up -d
```

@ -117,3 +117,4 @@ docker run -it -d --name halo -p 8090:8090 -v ~/.halo:/root/.halo --restart=unle
- **-p** 端口映射,格式为 `主机(宿主)端口:容器端口` ,可在 `application.yaml` 配置。
- **-v** 工作目录映射。形式为:-v 宿主机路径:/root/.halo后者不能修改。
- **--restart** 建议设置为 `unless-stopped`,在 Docker 启动的时候自动启动 Halo 容器。
Loading…
Cancel
Save