-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-Deposit
More file actions
37 lines (27 loc) · 1.03 KB
/
Dockerfile-Deposit
File metadata and controls
37 lines (27 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# BUILD Stage
FROM rust:1.89 as builder
WORKDIR /app
# Cache dependencies first
COPY Cargo.toml Cargo.lock ./
# Create a dummy main to cache deps efficiently
RUN mkdir -p src && echo "fn main() {}" > src/main.rs
RUN cargo build --release || true
# Now copy real sources
COPY tools-server ./tools-server
COPY graph-customer ./graph-customer
COPY graph-deposit ./graph-deposit
# Build the actual binary
RUN cargo build --release
# RUN Stage
FROM debian:bookworm-slim
# Install minimal runtime deps (ca-certificates in case future HTTP clients are added)
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 10001 appuser
# Copy the compiled binary
COPY --from=builder /app/target/release/graph-deposit /usr/local/bin/app
COPY --from=builder /app/graph-deposit/config/default.toml /usr/local/bin/default.toml
COPY --from=builder /app/graph-deposit/config/docker.toml /usr/local/bin/docker.toml
EXPOSE 8080
USER appuser
CMD ["/usr/local/bin/app"]