Add working configuration for how to run a slim Hugo container.

This commit is contained in:
2025-08-14 12:30:25 -07:00
parent 1284fc3946
commit 0ca793423b
3 changed files with 59 additions and 0 deletions

View File

@@ -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