Deployment
Deploy the Hermes Brain docs site with Docker and nginx.
This docs site is Hugo with the Lotus Docs theme, built inside Docker and served as static files by nginx.
Traffic path
Browser → host nginx (ports 80/443, TLS) → Docker container (hermes-docs, host port 8085) → nginx inside the container serving the built site.
Project folder
/mnt/Hermes-Brain-Doc on the server.
Docker commands
| Task | Command (in /mnt/Hermes-Brain-Doc) |
|---|---|
| Status | docker compose ps |
| Logs | docker compose logs -f docs |
| Stop | docker compose down |
| Start without rebuild | docker compose up -d |
| Rebuild after changes | docker compose up -d --build |
The container has restart: unless-stopped, so it comes back after a server reboot.
Rebuild and redeploy
cd /mnt/Hermes-Brain-Doc
docker compose up -d --build
This runs the Hugo build inside Docker and replaces the container. Downtime is only a few seconds. Hard-refresh your browser to see the change.
Preview locally
cd /mnt/Hermes-Brain-Doc
hugo server
Serves at http://localhost:1313. Requires Hugo Extended and Go on your machine.
Files that matter
- Dockerfile — multi-stage build. Hugo builds the site with
baseURL https://hermes-second-brain.mistrysiddh.in/, then nginx serves the output. - nginx.conf — config inside the container.
- docker-compose.yml — defines the single
docsservice. Port8085is bound to127.0.0.1only (not public). - hugo.toml — site-wide settings (title, menus, theme options).
- go.mod / go.sum — pin the Lotus Docs theme (v0.3.0), downloaded from GitHub.
Updating the theme
hugo mod get -u
Then rebuild with docker compose up -d --build.
Domain, DNS and host nginx
- DNS: an A record for
hermes-second-brainpoints to the server IP,200.97.175.246. Update this if the server moves. - Host nginx config:
/etc/nginx/conf.d/hermes-second-brain.mistrysiddh.in.conf- Port 80 redirects to HTTPS and allows the certbot challenge.
- Port 443 terminates TLS and proxies to
http://127.0.0.1:8085. - After any edit:
nginx -t && systemctl reload nginx.
- TLS certificate: Let’s Encrypt, in
/etc/letsencrypt/live/hermes-second-brain.mistrysiddh.in/, valid until 1 Feb 2027. Renew withcertbot renew. Test withcertbot renew --dry-run.
Changing the domain
Update four places:
- The DNS A record
server_nameand certificate paths in the host nginx config--baseURLin the DockerfilebaseURLinhugo.toml
Then get a new certificate with certbot certonly and rebuild.
Version control
The project folder is a git repository. Commit content changes:
cd /mnt/Hermes-Brain-Doc
git add -A
git commit -m "Update docs"
public/, resources/, and node_modules/ are git-ignored.
Troubleshooting
| Issue | Fix |
|---|---|
| Page not updating | Check the rebuild ran, then hard-refresh the browser |
| 502 Bad Gateway | Container is down. Run docker compose ps and docker compose up -d |
| Certificate warning | Certificate expired or renewal failed. Run certbot renew |
| Build fails | Run docker compose build and read the Hugo error — usually a front-matter or shortcode typo in a content file |