hugo-docker
hugo-docker copied to clipboard
✏️ Dockerized Hugo Extended with PostCSS, Babel, Pandoc, and more baked-in. Now with multi-architecture support!
✏️ Hugo Extended via Docker
A base image to ease local development of Hugo sites, including Hugo Extended (with SASS/SCSS support) and optional third-party tools (listed below). Now with multi-architecture images for native AMD64 and ARM64 support!
Usage
Command line
This will start a live server at http://localhost:1313/ from the Hugo site in your current directory:
docker run -v $(pwd):/src -p 1313:1313 jakejarvis/hugo-extended:latest server --buildDrafts --buildFuture --bind 0.0.0.0
docker-compose.yml
version: '3'
services:
hugo:
image: jakejarvis/hugo-extended:latest
ports:
- 1313:1313
volumes:
- ./:/src
command: server --buildDrafts --buildFuture --bind 0.0.0.0
Notes
When using Docker to run a live server (i.e. hugo server
), you must pass --bind 0.0.0.0
as an argument to fix some networking quirks between Hugo, the container, and the host.
Third-party software
Just in case, the final Alpine Linux container includes a few small third-party tools that are required by certain optional Hugo features:
- PostCSS
- Autoprefixer
- Babel
- Pygments
- Asciidoctor
- Pandoc
- Docutils / RST
- Embedded Dart Sass (amd64 only)
Node (with NPM and Yarn), Go (for Hugo Modules support), and Python are also pre-installed.
Licenses
This project is distributed under the MIT License. Hugo is distributed under the Apache License 2.0.