Skip to content

Commit

Permalink
build: build and minify css when creating docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Aug 2, 2024
1 parent f27494b commit 7da447c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
FROM oven/bun:1-alpine AS css-builder
WORKDIR /temp
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

COPY tailwind.config.js .
COPY src ./src
RUN bunx tailwindcss -i ./src/style.css -o ./out.css --minify

FROM --platform=$TARGETPLATFORM rust:1.80-alpine AS build
ARG TARGETPLATFORM

Expand All @@ -14,6 +23,7 @@ FROM scratch

WORKDIR /app
COPY ./static static
COPY --from=css-builder /temp/out.css ./static/style.css
COPY --from=build /usr/src/vesta/target/release/vesta /app/vesta

CMD ["/app/vesta"]
1 change: 0 additions & 1 deletion static/style.css

This file was deleted.

0 comments on commit 7da447c

Please sign in to comment.