diff options
author | Alan Pearce | 2023-09-22 08:40:59 +0200 |
---|---|---|
committer | Alan Pearce | 2023-09-22 12:03:47 +0200 |
commit | 3a2d198d153efc8a69e7640f7dcde88207268ff3 (patch) | |
tree | 7cec49484a6fbbf96121ff396afe1fd0425c4654 /Dockerfile | |
parent | 9c4fd37c97a87b9d1ab9e65b77e4578936b66323 (diff) | |
download | website-3a2d198d153efc8a69e7640f7dcde88207268ff3.tar.lz website-3a2d198d153efc8a69e7640f7dcde88207268ff3.tar.zst website-3a2d198d153efc8a69e7640f7dcde88207268ff3.zip |
Replace zola with DOM-based static site generation code
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 31 |
1 files changed, 15 insertions, 16 deletions
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" ] |