27 lines
760 B
Docker
27 lines
760 B
Docker
# Use a common python image
|
|
FROM python:3.10-slim
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
wget \
|
|
git \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Download and install Hugo
|
|
RUN wget -O /tmp/hugo.deb "https://github.com/gohugoio/hugo/releases/download/v0.129.0/hugo_extended_0.129.0_linux-amd64.deb" \
|
|
&& dpkg -i /tmp/hugo.deb \
|
|
&& rm /tmp/hugo.deb
|
|
|
|
# Create a directory for the site
|
|
WORKDIR /app
|
|
|
|
# Copy the update script and Python script
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
COPY update-site.py /usr/local/bin/update-site.py
|
|
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
# Run the update script in a loop
|
|
CMD ["/bin/sh", "-c", "while true; do /usr/local/bin/entrypoint.sh; sleep 30; done"]
|