From 3a2d198d153efc8a69e7640f7dcde88207268ff3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 22 Sep 2023 08:40:59 +0200 Subject: Replace zola with DOM-based static site generation code --- Dockerfile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 24a273a..e7771fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,34 +25,32 @@ COPY --link bun.lockb package.json ./ RUN bun install --ci # Copy application code -COPY --link src src - -FROM ghcr.io/getzola/zola:v${ZOLA_VERSION} as ssg - -WORKDIR /web - COPY --link config.toml config.toml -COPY --link themes themes +COPY --link src src +COPY --link bin bin +COPY --link content content COPY --link templates templates COPY --link static static -COPY --link content content -RUN [ "zola", "build", "--force" ] +RUN ./bin/build.ts && rm -r node_modules -FROM alpine:20230901 as postprocess +ENV NODE_ENV=production +RUN [ "bun", "install", "--production", "--ci" ] -WORKDIR /web +FROM alpine:20230901 as postprocess RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories RUN apk add --no-cache prettier@testing make fd brotli gzip zstd +WORKDIR /app + COPY --link Makefile ./ -COPY --from=ssg /web/config.toml ./ -COPY --from=ssg /web/public public +COPY --link config.toml ./ +COPY --from=build /app/public public -RUN make postprocess format -RUN make -j4 compress +RUN make format +# RUN make -j4 compress # Final stage for app image FROM base @@ -60,9 +58,10 @@ FROM base # Copy built application COPY config.toml /app/ COPY --from=build /app /app -COPY --from=postprocess /web/public /app/public # Start the server by default, this can be overwritten at runtime EXPOSE 3000 EXPOSE 9091 + +ENV NODE_ENV=production CMD [ "bun", "run", "src/index.ts" ] -- cgit 1.4.1