Sign inSign up

seedll/hexo

By seedll

•Updated 4 months ago

This is a Hexo using the latest version of Node.js, which is currently Node.js 24.

Image
0

2.3K

seedll/hexo repository overview

⁠Hexo 🐋

English | 简体中文⁠

Dockerized Hexo with Hexo Admin

A Hexo environment running the latest Node.js (currently Node.js 24).

https://github.com/SeeDLL/Ubuntu_Docker⁠

The image is available directly from Docker Hub⁠.

⁠Credits:

Node.js: https://hub.docker.com/_/node⁠

Hexo Blog Framework: https://hexo.io⁠


⁠Docker CLI Setup:
  1. Pull the Image

    SourceCommand
    Docker Hubdocker pull seedll/hexo:latest
  2. Create a Container

    docker create \
       --name=hexo \
       -p 4000:13389 \
       -e HEXO_SERVER_PORT=13389 \
       -e RUN_MODE=server \
       -e APP_CHECK_UPDATE=true \
       -e CUSTOM_SCRIPTS=true \
       -e CUSTOM_SCRIPT1="xx1.sh" \
       -e CUSTOM_SCRIPT2="xx2.sh" \
       -e GIT_USER=xxxxxx \
       -e [email protected] \
       -v {your_hexo_dir_path}:/app \
       -v {your_custom_scripts_dir_path}:/custom_scripts \
       --restart unless-stopped \
       seedll/hexo:latest
    
    VariableDescription
    HEXO_SERVER_PORTCustom port for Hexo server.
    RUN_MODEHexo operation mode: server (live server) or build (static site generation). Default: server.
    APP_CHECK_UPDATEIf true, checks for updates to Hexo and dependencies on container start.
    CUSTOM_SCRIPTSEnable (true/false) custom scripts execution.
    CUSTOM_SCRIPT1Filename for Script 1 (executed before requirements.txt installation).
    CUSTOM_SCRIPT2Filename for Script 2 (executed after requirements.txt installation).
    GIT_USERGit username configuration.
    GIT_EMAILGit email configuration.
    /appHost directory bound to Hexo’s working directory in the container.
    /custom_scriptsHost directory for custom scripts.
    LANG=zh-cnConfigures display language: zh-cn for Chinese, en_US for English

⁠Notes:
  • If the -v bound directory is empty, a fresh Hexo setup will be auto-initialized.
  • If the bound directory has existing Hexo files without node_modules, node_modules will be initialized.
  • If requirements.txt exists, required modules will be installed after node_modules initialization.
  • Set APP_CHECK_UPDATE=true to auto-update Hexo and dependencies on container start.

  1. Run

    • Static Site Generation (Build Mode):

      sudo docker run -it -d --name=GithubBlog \
        -e HEXO_SERVER_PORT=4000 \
        -e RUN_MODE=build \
        -e CUSTOM_SCRIPTS=true \
        -e CUSTOM_SCRIPT1="diy1.sh" \
        -e CUSTOM_SCRIPT2="diy2.sh" \
        -v /home/temp/code/MyBolgSource/:/app \
        -v /home/temp/code/custDir:/custom_scripts \
        -p 127.0.0.1:4000:4000 \
        seedll/hexo
      
    • Live Server Mode:

      sudo docker run -it -d --name=GithubBlog \
        -e HEXO_SERVER_PORT=4000 \
        -e RUN_MODE=server \
        -e CUSTOM_SCRIPTS=true \
        -e CUSTOM_SCRIPT1="diy1.sh" \
        -e CUSTOM_SCRIPT2="diy2.sh" \
        -v /home/temp/code/MyBolgSource/:/app \
        -v /home/temp/code/custDir:/custom_scripts \
        -p 127.0.0.1:4000:4000 \
        seedll/hexo
      
  2. Stop the Container

    docker stop hexo
    
  3. Remove the Container

    docker rm hexo
    
  4. Remove the Image

    docker image rm seedll/hexo:latest
    

⁠Key Adjustments:
  • Kept technical terms consistent (e.g., node_modules, requirements.txt).
  • Used imperative mood for commands (e.g., "Run", "Stop").
  • Simplified repetitive phrases (e.g., "检查并升级" → "auto-update").
  • Preserved code blocks, tables, and markdown formatting.

Let me know if you'd like any refinements!

Tag summary

Content type

Image

Digest

sha256:818342c40…

Size

116.9 MB

Last updated

4 months ago

docker pull seedll/hexo