• Stars
    star
    247
  • Rank 163,631 (Top 4 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker image for hugo static page generator (https://gohugo.io)

docker-hugo

Docker image for hugo static page generator (https://gohugo.io)

Environment Variables

  • HUGO_THEME
  • HUGO_WATCH (set to any value to enable watching)
  • HUGO_DESTINATION (Path where hugo will render the site. By default /output)
  • HUGO_REFRESH_TIME (in seconds, only applies if not watching, if not set, the container will build once and exit)
  • HUGO_BASEURL
  • HUGO_APPEND_PORT (set to false to prevent the default port to be appended to links)

Executing

docker run --name "my-hugo" -P -v $(pwd):/src jojomi/hugo

Or, more verbosely, and with a specified output mapping:

docker run --name "my-hugo" --publish-all \
       --volume $(pwd):/src \
       --volume /tmp/hugo-build-output:/output \
       jojomi/hugo

Find your container:

docker ps | grep "my-hugo"
CONTAINER ID        IMAGE                           COMMAND                CREATED             STATUS              PORTS                   NAMES
ba00b5c238fc        jojomi/hugo:latest   "/run.sh"              7 seconds ago       Up 6 seconds        1313/tcp      my-hugo

Building The Image Yourself (optional)

docker build -t jojomi/hugo:latest .

The image is conveniently small at about 20 MB thanks to alpine:

docker images | grep hugo
jojomi/hugo:0.18   latest              b2e7a8364baa        1 second ago      21.9 MB

Creating a new tag

Create a new git branch, change the line ENV HUGO_VERSION=0.18 in Dockerfile and wire it in the Docker Hub accordingly.

docker-compose

Using this docker image together with nginx for serving static data.

docker-compose.yml

hugo:
  image: jojomi/hugo:latest
  volumes:
    - ./src/:/src
    - ./output/:/output
  environment:
    - HUGO_REFRESH_TIME=3600
    - HUGO_THEME=mytheme
    - HUGO_BASEURL=mydomain.com
  restart: always

web:
  image: jojomi/nginx-static
  volumes:
    - ./output:/var/www
  environment:
    - VIRTUAL_HOST=mydomain.com
  ports:
    - 80
  restart: always

VIRTUAL_HOST is set for use with jwilder's nginx-proxy:

docker-compose.yml

proxy:
  image: jwilder/nginx-proxy
  ports:
    - 80:80
    - 443:443
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock
    - vhost.d:/etc/nginx/vhost.d:ro
  restart: always

Update Image on Hugo Update

./update.sh 0.25

More Repositories

1

github-opml

Create an opml file with references to all repositories starred by a GitHub user
Go
25
star
2

go-script

Go library facilitating the creation of programs that resemble bash scripts.
Go
14
star
3

gonsole

Develop sophisticated Console User Interfaces using Go. Based on termbox.
Go
14
star
4

rot

"I will delete that file later, promised" – because humans are so bad at keeping promises!
Go
6
star
5

generations

Genealogytree generator
Go
5
star
6

docker-caddy

Docker container for serving web content using caddy (https://caddyserver.com)
Dockerfile
4
star
7

docker-nginx-static

Docker container for serving static content using nginx
Nginx
4
star
8

go-latex

Go library for handling the creation LaTeX documents.
Go
4
star
9

docker-pageres

Docker container for pageres-cli
2
star
10

docker-lighttpd-static

Docker container for serving static content using lighttpd
HTML
2
star
11

brahms

Music Theory in Golang. This is Work In Progress.
Go
2
star
12

caddy-builder

Docker container for building Caddy webserver to avoid licensing problems
Shell
1
star
13

bkp

Simplify backup ontop of the awesome restic tool
Go
1
star
14

minprofile

Minimal golang profiling library. Get a quick overview of where time is spent in your code.
Go
1
star
15

git-config

modular git-config
Shell
1
star
16

docker-latex

Container for building LaTeX documents (using TeXlive)
Dockerfile
1
star
17

docker-latex-genealogytree

Plug 'n' Play Docker container for creating genealogy trees using LaTeX
TeX
1
star
18

remote-trigger

Allow local commands to be remotely triggered via HTTP. Think of git push hooks.
Go
1
star
19

matched

A little binary to check if parantheses or quote characters in a string are balanced.
Go
1
star