Files
hugo-webhook/Dockerfile
2025-10-07 22:46:46 +02:00

35 lines
1.1 KiB
Docker

FROM debian:bookworm-slim
ENV HUGO_VERSION $HUGO_VERSION
ENV WEBHOOK_VERSION $WEBHOOK_VERSION
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates curl unzip bash gnupg \
&& rm -rf /var/lib/apt/lists/*
# Install Hugo (Linux 64bit)
RUN curl -fsSL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" \
| tar -xzf - -C /tmp \
&& mv /tmp/hugo /usr/local/bin/hugo \
&& chmod +x /usr/local/bin/hugo \
&& rm -rf /tmp/hugo
# Install adnanh/webhook binary
RUN curl -fsSL "https://github.com/adnanh/webhook/releases/download/${WEBHOOK_VERSION}/webhook-linux-amd64.tar.gz" \
| tar -xzf - -C /tmp \
&& mv /tmp/webhook-linux-amd64/webhook /usr/local/bin/webhook \
&& chmod +x /usr/local/bin/webhook \
&& rm -rf /tmp/webhook-linux-amd64
# App layout
WORKDIR /app
COPY entrypoint.sh /app/entrypoint.sh
COPY hooks/update_site.sh /app/hooks/update_site.sh
RUN chmod +x /app/entrypoint.sh /app/hooks/update_site.sh
EXPOSE 1313 ${WEBHOOK_PORT}
ENTRYPOINT ["/app/entrypoint.sh"]