标签搜索

目 录CONTENT

文章目录

搭建halo博客并配置SSL证书

陈铭
2022-06-07 / 9 评论 / 9 点赞 / 2,343 阅读 / 225 字 / 正在检测是否收录...

创建挂载文件夹

# 创建.halo文件夹,放置配置文件和挂载数据
mkdir <custom_path>/.halo && cd <custom_path>/.halo

创建配置文件并添加ssl证书

具体配置细节见 https://docs.halo.run/getting-started/config

# 下载示例配置文件
wget https://dl.halo.run/config/application-template.yaml -O ./application.yaml

配置证书,放置在<custom_path>/.halo/ssl/<cert_file>,以便后续挂载进容器内

并修改上述的配置文件application.yaml,添加如下

server:
  port: 8090
  ssl:
    enabled: true
    key-store-password: <password>
    key-store-type: JKS
	# 这里是对应容器内的位置
    key-store: /root/.halo/ssl/<cert_file>

拉取并启动docker镜像

docker pull halohub/halo
# 容器内的/root/.halo路径是博客的数据存储位置,要挂载出来
docker run -it -d --name halo -p 8090:8090 -v <custom_path>/.halo:/root/.halo --restart=unless-stopped halohub/halo
9

评论区