GithubHelp home page GithubHelp logo

docker-hugo's Introduction

publysher/hugo

publysher/hugo is a Docker base image for static sites generated with Hugo.

Images derived from this image can either run as a stand-alone server, or function as a volume image for your web server.

Prerequisites

The image is based on the following directory structure:

.
├── Dockerfile
└── site
    ├── config.toml
    ├── content
    │   └── ...
    ├── layouts
    │   └── ...
    └── static
	└── ...

In other words, your Hugo site resides in the site directory, and you have a simple Dockerfile:

FROM publysher/hugo 

Building your site

Based on this structure, you can easily build an image for your site:

docker build -t my/image .

Your site is automatically generated during this build.

Using your site

There are two options for using the image you generated:

  • as a stand-alone image
  • as a volume image for your webserver

Using your image as a stand-alone image is the easiest:

docker run -p 1313:1313 my/image

This will automatically start hugo server, and your blog is now available on http://localhost:1313.

If you are using boot2docker, you need to adjust the base URL:

docker run -p 1313:1313 -e HUGO_BASE_URL=http://YOUR_DOCKER_IP:1313 my/image

The image is also suitable for use as a volume image for a web server, such as nginx

docker run -d -v /usr/share/nginx/html --name site-data my/image
docker run -d --volumes-from site-data --name site-server -p 80:80 nginx

Examples

For an example of a Hugo site, have a look at https://github.com/publysher/blog.publysher.nl

docker-hugo's People

Contributors

analogj avatar axilleas avatar bmackinney avatar fundor333 avatar jeffreycentex avatar mathuin avatar ndarilek avatar publysher avatar sashasimkin avatar stewmcc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-hugo's Issues

No asciidoc installed

Hugo sites that use asciidoc dont get rendered as the container doesnt seem to have asciidoc

Current Hugo Version 0.26

Version is outdated. Current version of Hugo is now 0.26.

Can you create multiple versions of this docker, or update to 0.26? Thanks for the docker image.

Server Bind instruction is required when using boot2docker on a Mac

Hello,

Thank you for the contribution. It was an inspiration source for my own implementation.

It would be worthwhile to add a warning to the README on how to run the containerized Hugo server on some configuration, It took me some frustrating hours to find out.

When using boot2docker (or Docker-machine with the VirtualBox provider) on a Mac OSX, the Hugo server must be started with the --bind=0.0.0.0 option as the interface bound by default (127.0.0.1) is not visible outside the virtual environement

I suggest to update the README with that information as you already give the advise for the IP address.

Enhancement request: support for tags on docker hub

Request:
Can the images pushed to publysher/hugo be tagged with the hugo release?

Reason:
I use gitlab CI and the publysher/hugo container image to update my website after every push. Sometimes my hugo is out of date locally, so my local test works fine, but then once pushed to gitlab the build fails because publysher/hugo has a more recent version of hugo. If the Docker hub images were tagged I would be able to manage this versioning much better.

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.