diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c1dfd89 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +public +node_modules +.wrangler +.git +manimations/*.* +/zola +/zola-v*.tar.gz +/artifacts diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a6d1f2f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Multi-stage build: generate llms.txt with Node, build the site with Zola, +# then serve the static output with static-web-server. +# +# This is the Dokploy/self-hosted deployment path. It's independent of the +# Cloudflare Pages path (`npm run deploy` / wrangler.toml) - that stays in +# place as an option, this doesn't replace it. + +FROM node:22-slim AS llms +WORKDIR /project +COPY . . +RUN node scripts/generate-llms.mjs + +FROM ghcr.io/getzola/zola:v0.23.1 AS zola +WORKDIR /project +COPY . . +COPY --from=llms /project/static/llms.txt static/llms.txt +RUN ["/zola", "build"] + +FROM ghcr.io/static-web-server/static-web-server:2 +COPY --from=zola /project/public /public +EXPOSE 80 diff --git a/build.sh b/build.sh index 6a378d6..812e673 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -ZOLA_VERSION=0.22.1 +ZOLA_VERSION=0.23.1 echo "Downloading Zola ${ZOLA_VERSION}..." curl -sLJO "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz"