about summary refs log tree commit diff stats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile31
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" ]