Add Dockerfile and gitea workflow

This commit is contained in:
2025-08-05 11:51:37 +08:00
parent c6fc0b093b
commit cc57dee334
3 changed files with 85 additions and 0 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM alpine:3.22.1 as zine
ARG ZINE_VERSION=v0.11.1
ARG TARGETARCH
RUN apk add --no-cache curl tar xz \
&& case "$TARGETARCH" in \
amd64) Z_ARCH="x86_64-linux-musl";; \
arm64) Z_ARCH="aarch64-linux-musl";; \
*) echo "Unsupported TARGETARCH: $TARGETARCH" && exit 1;; \
esac \
&& curl -L "https://github.com/kristoff-it/zine/releases/download/${ZINE_VERSION}/${Z_ARCH}.tar.xz" -o /tmp/zine.tar.xz \
&& tar -C /usr/local/bin -xJf /tmp/zine.tar.xz zine \
&& chmod +x /usr/local/bin/zine \
&& zine --version
FROM alpine:3.22.1 as builder
COPY --from=zine /usr/local/bin/zine /usr/local/bin/zine
WORKDIR /site
COPY . .
RUN zine release
FROM nginx:alpine3.22 AS runner
COPY --from=builder /site/public/ /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]