-
Notifications
You must be signed in to change notification settings - Fork 15
Using Hugo with Docker
To build and work on the devopsdays website locally with refresh capabilities you can use the Hugo Server Docker Container.
To use the Hugo Server Docker Container you will need to build the Hugo Docker Container first.
git clone https://github.com/DevOpsEventsNZ/docker-hugo.git
cd docker-hugo
./build
This should result in a local Hugo Docker Image devopsdays/docker-hugo:v0.36.1
First build the Hugo Server Docker Container.
git clone https://github.com/DevOpsEventsNZ/docker-hugo-server.git
cd docker-hugo-server
./build
This should result in a local Hugo Server Docker Image devopsdays/docker-hugo-server:0.36.1
Ensure you have checked out the devopsdays website locally. Change into the devopsdays-web directory.
You can run the server a couple of different ways:
docker run -p 1313:1313 -e VIRTUAL_HOST="http://localhost:1313" \
-v ${PWD}:/site --name hugo-server devopsdays/docker-hugo-server:0.36.1
Or:
../docker-hugo-server/hugoserver.sh http://localhost:1313
Or:
../docker-hugo-server/hugoserver.ps1 http://localhost:1313
The website is now available at http://localhost:1313 and any changes made on the the local files will be reflected in the running version.
NB: The syntax for the local path in the docker run command above may be different in Windows!