My personal site cherry.computer
htmx tailwind axum askama

Build production versions of components in Docker

+4 -2
+4 -2
Dockerfile
··· 6 6 RUN npm install 7 7 8 8 COPY frontend . 9 - RUN npm run build 9 + RUN npm run build:production 10 10 11 11 FROM rust:1.61 as builder-rs 12 12 13 13 WORKDIR /usr/src/myivo-server 14 14 COPY server . 15 15 16 - RUN cargo install --path . 16 + RUN cargo install --profile release --locked --path . 17 17 18 18 # run on different image 19 19 FROM debian:buster-slim ··· 23 23 WORKDIR /root 24 24 25 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 26 28 COPY --from=build-js /usr/src/myivo/images ./images 27 29 COPY --from=build-js /usr/src/myivo/fonts ./fonts 28 30 COPY --from=build-js /usr/src/myivo/build ./build