Skip to content

wenyg/blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BLOG

阳光的网络日志

这是一个基于 dockerhexo 博客环境,博客主题是 even

博客地址:

构建hexo镜像

构建hexo镜像,镜像里已经封装了搭建博客所需要的一切东西。构建镜像需要一些时间。

git clone https://github.com/wenyg/blog.git
cd blog
sudo docker build -t hexo .

快速开始

一键启动(推荐)

# 克隆项目
git clone https://github.com/wenyg/blog.git
cd blog

# 构建镜像(首次使用需要)
docker build -t wenyg/blog .

# 一键启动
./start.sh

启动后访问:http://localhost:4000

手动启动

BLOG_DIR="/home/wenyg/workspace/blog"
CONTAINER_BLOG_DIR="/blog"
docker run -d --name hexo \
	-v ${BLOG_DIR}/source:${CONTAINER_BLOG_DIR}/source \
	-v ${BLOG_DIR}/themes/even:${CONTAINER_BLOG_DIR}/themes/even \
	-v ${BLOG_DIR}/_config.yml:${CONTAINER_BLOG_DIR}/_config.yml \
	-p 4000:4000 \
	wenyg/blog /bin/bash -lic "hexo serve"

常用命令

# 启动服务
./start.sh

# 停止服务
./stop.sh

# 查看日志
docker logs -f hexo

# 重启服务
docker restart hexo

目录说明

  • source: 博客目录,所写的博客基本上都放在此目录下的_posts目录下,添加新文章只需要把markdown文件放到此目录即可
  • _config.yml: hexo的配置文件,包括站点设置,部署设置等等,具体查看 hexo配置
  • themes: 主题目录,里面的是 even 主题
  • Dockerfile: 构建docker镜像的脚本
  • start.sh: 一键启动脚本(推荐使用)

About

阳光的网络日志

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages