From 0ca793423b024b16aff6c31ee775e462d3ed4ce7 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Thu, 14 Aug 2025 12:30:25 -0700 Subject: [PATCH] Add working configuration for how to run a slim Hugo container. --- Config/HugoExample/Dockerfile | 28 +++++++++++++++++++ Config/HugoExample/docker-compose.example.yml | 20 +++++++++++++ Config/HugoExample/env.example | 11 ++++++++ 3 files changed, 59 insertions(+) create mode 100644 Config/HugoExample/Dockerfile create mode 100644 Config/HugoExample/docker-compose.example.yml create mode 100644 Config/HugoExample/env.example diff --git a/Config/HugoExample/Dockerfile b/Config/HugoExample/Dockerfile new file mode 100644 index 0000000..dc98984 --- /dev/null +++ b/Config/HugoExample/Dockerfile @@ -0,0 +1,28 @@ +# 2025-08-13 Hyperling + +## Image ## +FROM debian:bookworm-slim + +## Setup ## +# Cache System Dependencies +RUN apt-get update && apt-get install -y git hugo sudo curl wget bash + +# User and Group +RUN groupadd -r hugo && useradd -r -s /usr/bin/bash -g hugo hugo + +# Directory Tree +RUN mkdir -pv /var/www/hugo && chown -Rv hugo:hugo /var/www/hugo + +## Main ## +# Install + Run Website +WORKDIR /var/www/hugo +USER hugo +CMD echo "*** Cloning Repo $REPO ***" && \ + cd /var/www/hugo && \ + rm -rfv site && \ + git clone --recurse-submodules $REPO site && \ + cd site && \ + mkdir -pv public && \ + echo "*** Starting Hugo ***" && \ + hugo version && \ + hugo server -D --noBuildLock --bind 0.0.0.0 diff --git a/Config/HugoExample/docker-compose.example.yml b/Config/HugoExample/docker-compose.example.yml new file mode 100644 index 0000000..8e5a5e2 --- /dev/null +++ b/Config/HugoExample/docker-compose.example.yml @@ -0,0 +1,20 @@ +# 2025-08-13 +# Configuration for running a Hugo website pulled from Git. + +services: + app: + container_name: hugo + build: + context: ./ + network: host + restart: always + ports: + - 8013:1313 + environment: + - REPO=$REPO + deploy: + mode: global + resources: + limits: + cpus: '0.10' + memory: 32M diff --git a/Config/HugoExample/env.example b/Config/HugoExample/env.example new file mode 100644 index 0000000..7657cb4 --- /dev/null +++ b/Config/HugoExample/env.example @@ -0,0 +1,11 @@ +# 2025-08-13 Hyperling + +# +## Docker ## +# +COMPOSE_BAKE=true + +# +## Git Website Repository +# +REPO=https://git.hyperling.com/me/hugo-jackanope