Hi, I want to be able to deploy using docker compose a website with this theme: https://github.com/razonyang/hugo-theme-bootstrap-skeleton on my private server. I find myself unable to create such a docker-compose.yaml to do so, can someone please help me with it?
2023-08-22 16:38:41 WARN no such image can be found in page resources and the static folder: images/logo.webp
2023-08-22 16:38:41 WARN no such image can be found in page resources and the static folder: images/profile.webp
2023-08-22 16:38:44 ERROR render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: docs/single.html:12:8: executing "docs/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
2023-08-22 16:38:44 ERROR render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: _default/single.html:12:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
2023-08-22 16:38:44 ERROR render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: _default/contact.html:12:8: executing "_default/contact.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
2023-08-22 16:38:44 Built in 74324 ms
2023-08-22 16:38:44 Error: error building site: render: failed to render pages: render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: docs/single.html:12:8: executing "docs/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
Couldn’t reproduce it, you can consider increacing the timeout in configuration file if there are a lot of pages on your site.
Btw, you may need to change the command as hugo server -p 6969 --bind 0.0.0.0, since the URLs is related to the baseURL (localhost:1313 by default on hugo server), otherwise you may encounter unexpected problems. You’ll need to adjust the ports as well.
I followed exactly as what you had explained in your post but I still encounter this error:
MYCOMPUTER MINGW64 /f/website
$ git clone git@github.com:razonyang/hugo-theme-bootstrap-skeleton.git
Cloning into 'hugo-theme-bootstrap-skeleton'...
remote: Enumerating objects: 7347, done.
remote: Counting objects: 100% (737/737), done.
remote: Compressing objects: 100% (262/262), done.
remote: Total 7347 (delta 442), reused 541 (delta 346), pack-reused 6610
Receiving objects: 100% (7347/7347), 4.60 MiB | 3.65 MiB/s, done.
Resolving deltas: 100% (3616/3616), done.
Updating files: 100% (78/78), done.
MYCOMPUTER MINGW64 /f/website
$ cd hugo-theme-bootstrap-skeleton
MYCOMPUTER MINGW64 /f/website/hugo-theme-bootstrap-skeleton (main)
$ npm ci
npm WARN deprecated @braintree/sanitize-url@3.1.0: Potential XSS vulnerability patched in v6.0.0.
added 514 packages, and audited 515 packages in 2m
47 packages are looking for funding
run `npm fund` for details
13 vulnerabilities (2 moderate, 11 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
MYCOMPUTER MINGW64 /f/website/hugo-theme-bootstrap-skeleton (main)
$ vim docker-compose.yaml
MYCOMPUTER MINGW64 /f/website/hugo-theme-bootstrap-skeleton (main)
$ docker compose up
Network hugo-theme-bootstrap-skeleton_default Creating
Network hugo-theme-bootstrap-skeleton_default Created
Container private-website-server Creating
Container private-website-server Created
Attaching to private-website-server
private-website-server | hugo: downloading modules …
private-website-server | hugo: collected modules in 5147 ms
private-website-server | Watching for changes in /src/{archetypes,assets,content,layouts,package.hugo.json,package.json,static}
private-website-server | Watching for config changes in /src/config/_default, /src/go.mod
private-website-server | Start building sites …
private-website-server | hugo v0.117.0-b2f0696cad918fb61420a6aff173eb36662b406e+extended linux/amd64 BuildDate=2023-08-07T12:49:48Z
private-website-server |
private-website-server | ERROR render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: _default/single.html:12:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
private-website-server | ERROR render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: docs/single.html:12:8: executing "docs/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
private-website-server | Built in 83466 ms
private-website-server | Error: error building site: render: failed to render pages: render of "page" failed: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/razonyang/hugo-theme-bootstrap@v1.2.2/layouts/_default/baseof.html:12:8": execute of template failed: template: _default/single.html:12:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: partial "head.html" timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the 'timeout' config setting.
private-website-server exited with code 1
private-website-server | Watching for changes in /src/{archetypes,assets,content,layouts,package.hugo.json,package.json,static}
private-website-server | Watching for config changes in /src/config/_default, /src/go.mod
private-website-server | Start building sites …
private-website-server | hugo v0.117.0-b2f0696cad918fb61420a6aff173eb36662b406e+extended linux/amd64 BuildDate=2023-08-07T12:49:48Z
Not too sure what is wrong with it, it keeps saying it goes into an infinite recursion. It is quite upsetting because I think your Theme is one of the most beautiful themes on Hugo and I would love to use it for my engineering blog.
Does it work when using native Hugo command other than docker-compose? Is the docker-compose work for other themes?
From the logs, there maybe an IO performance issue on your machine.
added 514 packages, and audited 515 packages in **2m**
It takes too long to install the dependencies (2m, NPM) and build the site (Hugo). The former took 25s, and later took 8s on my Windows, Linux should be more faster. GitHub Action is about the same.
Hi @razon, I understand that using command: "hugo server" to run a blog in production is not the best way to do; you have a documentation on how to deploy using Dockerfile[link], can you help me to deploy using docker-compose.yaml as well?
Also, running the Dockerfile itself using docker run gives me this error:
That’s expected, since the default command of this image is hugo version, so it prints Hugo version and then exit. To override the default command, you’ll need to append it to the end, e.g. docker run hugomods/hugo hugo server for running a Hugo server.
You’ll need to 1) either upgrade Hugo to v0.112.0 (or later), 2) or append the PWD to security.funcs.getenv.