Files
env-docker/Config/HugoExample/Dockerfile
T

50 lines
1.1 KiB
Docker

# 2025-08-13 Hyperling
# Changelog
## 20261027: Install hugo from source. paperMod currently requires ~150 and Debian has ~130, latest is ~160.
## Image ##
FROM debian:trixie-slim
USER root
## Setup ##
ARG DEBIAN_FRONTEND=noninteractive
# System Dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git nginx cron curl bash sudo \
golang gcc && \
rm -rf /var/lib/apt/lists/*
# Compile Hugo
RUN CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
# Install Hugo
RUN ln -s $HOME/go/bin/hugo /usr/local/bin/hugo
# User and Group
#RUN groupadd -r hugo && useradd -r -g hugo hugo
# Hugo Directory Tree
RUN mkdir -pv /var/www/hugo/
# NGINX Directory Tree
RUN mkdir -pv /var/www/html/
# Copy Cron Job to Update Git Repo
COPY files/crontab /etc/crontab
COPY files/cronjob.sh /var/www/hugo/cronjob.sh
# Hugo User Permissions
RUN chown -Rv www-data:www-data /var/www/
RUN chmod +x /var/www/hugo/cronjob.sh
# Copy Start Script
COPY files/main.sh /root/main.sh
RUN chmod +x /root/main.sh
## Main ##
# Install + Run Website
WORKDIR /var/www/
CMD /root/main.sh "$REPO" "$BRANCH" "$PROD" "$DEV"