trying a new automation tool

This commit is contained in:
2025-10-09 21:55:01 -05:00
parent 67a99e0e97
commit 7df7b0b0b2
3 changed files with 63 additions and 17 deletions

View File

@@ -1,25 +1,28 @@
# --- Stage 1: Build Zola site ---
FROM alpine:3.20 AS builder
RUN echo "@community https://dl-cdn.alpinelinux.org/alpine/v3.20/community" \
>> /etc/apk/repositories && \
apk add --no-cache zola git
RUN echo "@community https://dl-cdn.alpinelinux.org/alpine/v3.20/community" >> /etc/apk/repositories && \
apk add --no-cache git zola bash
WORKDIR /site
COPY src/ .
RUN git clone --depth=1 --recurse-submodules https://git.rbitton.com/rbitton/Website.git .
RUN git clone https://git.rbitton.com/rbitton/Resume.git /tmp/resume && \
mkdir -p static/files && \
mkdir -p content/resume && \
# cp /tmp/resume/RAPHAEL_BITTON.pdf static/files/ && \
sh -c "(printf '+++\n\
title = \"Resume\"\n\
date = 2025-10-09\n\
+++\n\n' && cat /tmp/resume/RAPHAEL_BITTON.md) > content/resume/_index.md"
WORKDIR /site/src
RUN zola build --force
FROM nginx:alpine
COPY --from=builder /site/public /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
# --- Stage 2: Runtime ---
FROM python:3.12-alpine
RUN apk add --no-cache nginx git zola bash
COPY --from=builder /site /site
COPY --from=builder /site/src/public /usr/share/nginx/html
COPY --from=builder /site/webhook.py /usr/local/bin/webhook.py
ENV DEPLOY_SECRET="supersecret"
WORKDIR /site/src
EXPOSE 80 5001
CMD sh -c "python3 /usr/local/bin/webhook.py & nginx -g 'daemon off;'"