Developer Documents How to Containerize a Hugo Portfolio Site Using Docker and Nginx
A developer shared a step-by-step account of packaging a Hugo-based portfolio website into a Docker container to ensure consistent deployment across different machines. The setup required a two-stage Dockerfile: one stage uses Hugo to compile the site into static files, and a second lightweight Nginx stage serves those files to visitors. An initial build failure revealed that the Hugo template also depended on Node.js and npm tooling, which had to be explicitly installed and run before Hugo could complete its build. Port mapping errors during container startup were traced to a misunderstood Docker flag format and a port conflict on the host machine. A redirect bug on the /cv page was also resolved by configuring Nginx to use relative paths instead of assuming the container's internal port number.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in