all repos — homestead @ 4cdd583a5ce9428a3e5211213fc44b09fddba618

Code for my website

Replace zola with DOM-based static site generation code

Alan Pearce
commit

4cdd583a5ce9428a3e5211213fc44b09fddba618

parent

234c9eadf1e7965fc3a6a669696ddae5e2c4ef11

1 file changed, 15 insertions(+), 16 deletions(-)

changed files
M DockerfileDockerfile
@@ -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 + +ENV NODE_ENV=production +RUN [ "bun", "install", "--production", "--ci" ] FROM alpine:20230901 as postprocess -WORKDIR /web - 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 @@
# 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" ]