https://github.com/taskbjorn/docker-hexo
Docker container for Hexo - a fast, simple and powerful blog framework powered by Node.js - based on Alpine Linux.
https://github.com/taskbjorn/docker-hexo
alpine blogging docker docker-compose hexo linux static-site-generator
Last synced: 11 months ago
JSON representation
Docker container for Hexo - a fast, simple and powerful blog framework powered by Node.js - based on Alpine Linux.
- Host: GitHub
- URL: https://github.com/taskbjorn/docker-hexo
- Owner: taskbjorn
- License: gpl-3.0
- Created: 2021-08-05T20:58:54.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-09-02T19:16:12.000Z (almost 2 years ago)
- Last Synced: 2025-03-29T12:04:09.441Z (about 1 year ago)
- Topics: alpine, blogging, docker, docker-compose, hexo, linux, static-site-generator
- Language: Dockerfile
- Homepage: https://git.dsme.cc/taskbjorn/docker-hexo
- Size: 20.5 KB
- Stars: 3
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quick reference
* **Maintained by:** [taskbjorn](https://github.com/taskbjorn)
* **Official Git repository:** [docker-hexo on GitHub](https://github.com/taskbjorn/docker-hexo)
# Supported tags and respective Dockerfile links
* [`latest`, `5.2.0`](https://github.com/taskbjorn/docker-hexo/build/latest/Dockerfile)
# What is `docker-hexo`?

`docker-hexo` is a Docker container for the Hexo blog framework based on Alpine Linux.
# Running using Docker or Docker Compose
To run the container and persist data across container restarts, create a volume with a name of your choice (`hexo_data`, in this example) and run the following:
```bash
docker volume create my_hexo_data
docker run -it --name my_hexo_container -p 4000:4000 -v hexo_data:/home/hexo/.hexo taskbjorn/hexo
```
Your blog will then be available at `http://0.0.0.0:4000` on your host.
If you use Docker Compose. you may use the example [Compose file](https://git.dsme.cc/taskbjorn/docker-hexo/compose/docker-compose.yml) provided in this repository. Make sure to adjust the configuration (container names, volume names, ports, etc.) to fit your needs.
# How to use `docker-hexo`
On first run, the container initializes a new site in `/home/hexo/.hexo`. The static pages are then served through the integrated web server `hexo-server` running on the container port `4000`. If a pre-populated volume is mounted at `/home/hexo/.hexo`, then no new site is initialized and the pre-existing contents of the volume are served instead.
To use Hexo, you may run a command inside the Docker container as follows:
```bash
docker exec my_hexo_container hexo
```
You can find the list of available commands on the [Commands](https://hexo.io/docs/commands.html) page of the official Hexo documentation.
Alternatively, you may open an interactive shell which will start in the root of your blog and give you direct access to the `hexo` command:
```bash
docker exec -it my_hexo_container sh
hexo generate
```
# License
This image is licensed under [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
As it is often the case with Docker images, some of the software contained in this image (e.g. the base image, software included in the base image, etc.) may be covered under a difference license.
Please remember it is your responsibility as the end-user to ensure that your use case complies with the licenses of all included software.