Docker Stack For Deploying A Website Using Hugo And Git
2.6K
githugo clones a remote git repository, builds it with Hugo, and then hosts it using NGINX. Use Docker Compose or Docker Swarm to deploy. There are examples for using NGINX or Traefik for SSL termination, or don't use SSL at all.
Configuration consists of environment variables in the .yml and .conf files.
.yml (replace all instances of yourdomain, LINK_TO_GIT_REPO, GIT_REPO_NAME).I personally use this with Traefik as a reverse proxy, I've included an example traefik.yml but it's not necessary.
You'll need to create the appropriate Docker Secrets and Docker Configs.
Run with docker stack deploy --compose-file docker-swarm.yml website
You'll need to create a config folder and put website_nginx.conf in it, if you're using NGINX for SSL also put your SSL certificate and SSL key in it.
Run with docker-compose up -d. View using yourdomain.test:9080 or 127.0.0.1:9080.
Content type
Image
Digest
Size
28.2 MB
Last updated
over 5 years ago
docker pull zeigren/githugo