Update README.md

Include the Docker compose configuration file content for automatic version updates.
pull/273/head
酷曦科技 2024-12-17 00:06:21 +08:00 committed by GitHub
parent 1c0cfd6769
commit b101ac7c7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 48 additions and 1 deletions

View File

@ -90,7 +90,7 @@ https://certd.handfree.work/
1. 修改`docker-compose.yaml`中的镜像版本号
2. 运行`docker compose up -d` 即可
如果使用`latest`版本
如果需要使用最新版本
```shell
#重新拉取镜像
docker pull registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
@ -98,7 +98,54 @@ docker pull registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
docker compose down
docker compose up -d
```
关于自动升级(仅限尝鲜建议非生产使用)
```yaml
version: '3.3'
services:
certd:
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
container_name: certd
restart: unless-stopped
volumes:
- /data/certd:/app/data
ports:
- "7001:7001"
- "7002:7002"
# 如果需要修改系统配置,可以通过环境变量传递;初次运行请保持默认配置
environment:
- certd_system_resetAdminPasswd=false
# 如果需要切换数据库类型可以在此处设置为mysql或postgres
# - certd_typeorm_dataSource_default_type=mysql
# - certd_typeorm_dataSource_default_host=localhost
# - certd_typeorm_dataSource_default_port=3306
# - certd_typeorm_dataSource_default_username=root
# - certd_typeorm_dataSource_default_password=123456
# - certd_typeorm_dataSource_default_database=certd
labels:
com.centurylinklabs.watchtower.enable: "true"
certd-updater: # 添加 Watchtower 服务
image: containrrr/watchtower:latest
container_name: certd-updater
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# 配置 自动更新
environment:
- WATCHTOWER_CLEANUP=true # 自动清理旧版本容器
- WATCHTOWER_INCLUDE_STOPPED=false # 不更新已停止的容器
- WATCHTOWER_LABEL_ENABLE=true # 根据容器标签进行更新
- WATCHTOWER_POLL_INTERVAL=300 # 每 5 分钟检查一次更新
# 如果需要支持 IPv6请取消以下注释
# networks:
# ip6net:
# enable_ipv6: true
# ipam:
# config:
# - subnet: 2001:db8::/64
```
> 数据默认存在`/data/certd`目录下,不用担心数据丢失