File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM debian:buster-slim
2- RUN apt-get update && \
3- apt-get install -y libssl-dev && \
4- rm -rf /var/lib/apt/lists/*
1+ FROM rust:1.91.0-slim-trixie AS builder
2+
3+ ENV ROCKET_PROFILE=release
4+
5+ WORKDIR /app
6+
7+ COPY cryptify-back-end/src ./src
8+ COPY cryptify-back-end/templates ./templates
9+ COPY cryptify-back-end/Cargo.toml .
10+ COPY cryptify-back-end/Cargo.lock .
11+
12+ RUN apt-get update \
13+ && apt-get --no-install-recommends install -y libssl-dev pkg-config \
14+ && rm -rf /var/lib/apt/lists/* \
15+ && cargo build --release \
16+ && cp ./target/release/cryptify-backend /usr/local/bin/cryptify-backend
17+
18+
19+ FROM debian:trixie-slim
20+ ENV ROCKET_CONFIG=config.toml
21+
22+ RUN groupadd -r nonroot \
23+ && useradd -r -g nonroot nonroot \
24+ && apt-get update \
25+ && apt-get --no-install-recommends install -y ca-certificates libssl3 \
26+ && rm -rf /var/lib/apt/lists/*
27+
28+ COPY --from=builder /usr/local/bin/cryptify-backend /usr/local/bin/cryptify-backend
29+ RUN mkdir -p /app && chown nonroot:nonroot /app
30+
31+ WORKDIR /app
32+ USER nonroot
33+
34+ RUN mkdir -p /tmp/data
35+
36+ CMD ["/bin/sh" , "-c" , "/usr/local/bin/cryptify-backend" ]
You can’t perform that action at this time.
0 commit comments