Scalable and distributed custom feed generator, ott - on that topic

Add rust template dockerimage

+82
+56
.dockerignore
··· 1 + # Git 2 + .git 3 + .gitignore 4 + .gitattributes 5 + 6 + # Rust 7 + **/target/ 8 + *.rlib 9 + *.rmeta 10 + *.so 11 + *.dylib 12 + 13 + # Helm 14 + chart/ 15 + charts/ 16 + *.tgz 17 + .helmignore 18 + 19 + # IDE/Editor 20 + .vscode/ 21 + .idea/ 22 + *.swp 23 + *.swo 24 + *~ 25 + .DS_Store 26 + .env 27 + .env.local 28 + 29 + # Build artifacts 30 + build/ 31 + dist/ 32 + bin/ 33 + *.exe 34 + *.o 35 + *.a 36 + 37 + # Node (if you have any frontend) 38 + node_modules/ 39 + npm-debug.log 40 + 41 + # Documentation 42 + docs/ 43 + README.md 44 + CHANGELOG.md 45 + LICENSE 46 + 47 + # Test artifacts 48 + .coverage 49 + 50 + # Misc 51 + .dockerignore 52 + Dockerfile 53 + docker-compose.yml 54 + skaffold.yaml 55 + skaffold.env 56 + kind-config.yaml
+26
docker/rust-service/Dockerfile
··· 1 + FROM rust:1 AS chef 2 + # We only pay the installation cost once, 3 + # it will be cached from the second build onwards 4 + RUN cargo install cargo-chef 5 + WORKDIR /workspace 6 + 7 + 8 + FROM chef AS planner 9 + COPY crates . 10 + RUN cargo chef prepare --recipe-path recipe.json 11 + 12 + FROM chef AS builder 13 + ARG CRATE_NAME 14 + COPY --from=planner /workspace/recipe.json recipe.json 15 + # Build dependencies - this is the caching Docker layer! 16 + RUN cargo chef cook --release --recipe-path recipe.json 17 + # Build application 18 + COPY crates . 19 + RUN cargo build --release --bin ${CRATE_NAME} 20 + 21 + # We do not need the Rust toolchain to run the binary! 22 + FROM debian:bookworm-slim AS runtime 23 + ARG CRATE_NAME 24 + WORKDIR /workspace 25 + COPY --from=builder /workspace/target/release/${CRATE_NAME} /usr/local/bin/app 26 + ENTRYPOINT ["/usr/local/bin/app"]