My personal site cherry.computer
htmx tailwind axum askama

Build frontend app in Docker too

+20 -7
+2 -4
.dockerignore
··· 1 - * 2 !frontend 3 frontend/node_modules 4 - frontend/src 5 - frontend/esbuild.js 6 - frontend/tsconfig.json 7 !server 8 server/target
··· 1 + */ 2 !frontend 3 frontend/node_modules 4 + frontend/build 5 !server 6 server/target
+18 -3
Dockerfile
··· 1 - FROM rust:1.61 as builder 2 3 WORKDIR /usr/src/myivo-server 4 COPY server . ··· 10 11 RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/* 12 13 - COPY frontend . 14 - COPY --from=builder /usr/local/cargo/bin/myivo-server /usr/local/bin/myivo-server 15 16 EXPOSE 8080 17
··· 1 + FROM node:16 as build-js 2 + 3 + WORKDIR /usr/src/myivo 4 + 5 + COPY frontend/package*.json . 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 . ··· 20 21 RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/* 22 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 29 + COPY --from=builder-rs /usr/local/cargo/bin/myivo-server /usr/local/bin/ 30 31 EXPOSE 8080 32