Giter Site home page Giter Site logo

docker-hexo's Introduction

Hexo ๐Ÿ‹

Follow Docker Pulls Build Status

Dockerfile for Hexo with Hexo Admin

The image is available directly from Docker Hub

A tutorial is available at spurin.com

Latest update locks the node version to 13-slim rather than slim (which at the time of writing is 14), whilst Hexo appears to work for most areas, there is at present an outstanding issue that prevents the hexo deploy working with 14. See Hexo 4275

Getting Started

Create a new blog container, substitute domain.com for your domain and specify your blog location with -v target:/app, specify your git user and email address (for deployment):

docker create --name=hexo-domain.com \
-e HEXO_SERVER_PORT=4000 \
-e GIT_USER="Your Name" \
-e GIT_EMAIL="[email protected]" \
-v /blog/domain.com:/app \
-p 4000:4000 \
spurin/hexo

If a blog is not configured in /app (locally as /blog/domain.com) already, it will be created and Hexo-Admin will be installed into the blog as the container is started

docker start hexo-domain.com

Accessing the container

Should you wish to perform further configuration, i.e. installing custom themes, this should be viable from the app specific volume, either directly or via the container (changes to the app volume are persistent). Accessing the container -

docker exec -it hexo-domain.com bash

Deployment keys for use with Github/Gitlab

Deployment keys are configured as part of the initial app configuration, see the .ssh directory within your app volume or, view the logs upon startup for the SSH public key

docker logs --follow hexo-domain.com

Installing a theme

Each theme will vary but for example, a theme such as Hueman, clone the repository to the themes directory within the app volume

cd /app
git clone https://github.com/ppoffice/hexo-theme-hueman.git themes/hueman

Update _config.yml in your app folder, and change theme accordingly

theme: hueman

Enable the default configuration

mv themes/hueman/_config.yml.example themes/hueman/_config.yml

Exit the container

exit

And restart the container

docker restart hexo-domain.com

Accessing Hexo

Access the default hexo blog interface at http://< ip_address >:4000

Accessing Hexo-Admin

Access Hexo-Admin at http://< ip_address >:4000/admin

Generating Content

docker exec -it hexo-domain.com hexo generate

Deploying Generated Content

docker exec -it hexo-domain.com hexo deploy

Adding hexo plugins

If you wish to add specific hexo plugins, add them to a requirements.txt file to your app volume, for example (app/requirements.txt) -

hexo-generator-json-content

During startup, if the requirements.txt file exists, requirements are auto installed

docker-hexo's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.