My personal site cherry.computer
htmx tailwind axum askama

Build production versions of components in Docker

+4 -2
+4 -2
Dockerfile
··· 6 RUN npm install 7 8 COPY frontend . 9 - RUN npm run build 10 11 FROM rust:1.61 as builder-rs 12 13 WORKDIR /usr/src/myivo-server 14 COPY server . 15 16 - RUN cargo install --path . 17 18 # run on different image 19 FROM debian:buster-slim ··· 23 WORKDIR /root 24 25 COPY --from=build-js /usr/src/myivo/index.html ./ 26 COPY --from=build-js /usr/src/myivo/images ./images 27 COPY --from=build-js /usr/src/myivo/fonts ./fonts 28 COPY --from=build-js /usr/src/myivo/build ./build
··· 6 RUN npm install 7 8 COPY frontend . 9 + RUN npm run build:production 10 11 FROM rust:1.61 as builder-rs 12 13 WORKDIR /usr/src/myivo-server 14 COPY server . 15 16 + RUN cargo install --profile release --locked --path . 17 18 # run on different image 19 FROM debian:buster-slim ··· 23 WORKDIR /root 24 25 COPY --from=build-js /usr/src/myivo/index.html ./ 26 + # point to minimised, production versions of build artefacts 27 + RUN sed -i "s|build/app|build/app.min|g" index.html 28 COPY --from=build-js /usr/src/myivo/images ./images 29 COPY --from=build-js /usr/src/myivo/fonts ./fonts 30 COPY --from=build-js /usr/src/myivo/build ./build