Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/publysher/docker-hugo
Docker base image for static sites generated with Hugo
https://github.com/publysher/docker-hugo
Last synced: about 2 months ago
JSON representation
Docker base image for static sites generated with Hugo
- Host: GitHub
- URL: https://github.com/publysher/docker-hugo
- Owner: publysher
- License: mit
- Created: 2014-09-28T12:03:47.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-12T14:50:05.000Z (almost 5 years ago)
- Last Synced: 2024-07-10T07:46:35.960Z (3 months ago)
- Language: Makefile
- Homepage:
- Size: 9.77 KB
- Stars: 51
- Watchers: 3
- Forks: 76
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
publysher/hugo
==============`publysher/hugo` is a [Docker](https://www.docker.io) base image for static sites generated with [Hugo](http://gohugo.io).
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 webserverUsing 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](https://registry.hub.docker.com/_/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 nginxExamples
--------For an example of a Hugo site, have a look at https://github.com/publysher/blog.publysher.nl