Dockerfiles/hexo/README.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2018-01-15 09:11:34 +00:00
# Dockered Hexo
2016-11-11 10:33:18 +00:00
2018-01-15 09:11:34 +00:00
## What is `Hexo`
2016-11-30 12:47:38 +00:00
2018-01-15 09:11:34 +00:00
> `Hexo` is a fast, simple and powerful blog framework. You write posts in Markdown (or other languages) and Hexo generates static files with a beautiful theme in seconds.
Documents: [Hexo](https://hexo.io/)
## How to setup your Hexo blog quickly
1. Create a new directory in your computer (for example: `/path/to/blog`)
2. Create a docker service using the following command
3. View http://localhost:4000 to see your running blog
```
2016-12-01 03:51:10 +00:00
docker service create \
--name hexo \
2018-01-15 09:11:34 +00:00
--replicas 1 \
--publish 4000:4000 \
--env GIT_EMAIL="username@example.com" \
--env GIT_NAME="username" \
--mount type=bind,source=/path/to/blog,target=/blog \
2016-12-01 03:51:10 +00:00
newnius/hexo
2018-01-15 09:11:34 +00:00
```
2016-11-30 12:47:38 +00:00
2018-01-15 09:11:34 +00:00
## Notice
_This command creates a docker swarm service, you can use `docker run ...` instead in your way_
_The first time you run this command, it will init the blog and will take some time to install some packages._
_If you live in China, the npm source mirror is blocked and the inititial may not be completed, you can download the required packages and put them where they should be._