Added build action and kubernetes manifests

This commit is contained in:
2025-04-14 18:40:59 +02:00
parent eaadf02220
commit 5f0a0ade8c
16 changed files with 333 additions and 4 deletions

22
Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM rust:1.85 AS base
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN cargo install cargo-chef --locked --version 0.1.71 && \
cargo install cargo-auditable --locked --version 0.6.6
WORKDIR /app
FROM base AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM base AS builder
COPY --from=planner /app/recipe.json recipe.json
ENV RUSTC_BOOTSTRAP=1
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
ENV RUSTC_BOOTSTRAP=1
RUN cargo auditable build --release
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
COPY --from=builder /app/target/release/tunnel_rs /tunnel_rs
CMD ["/tunnel_rs"]