-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 1.53 KB
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 1.53 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
# ── Stage 1: build ────────────────────────────────────────────────────────────
FROM rust:1.88-bookworm AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN mkdir -p src/bin benches && \
echo 'fn main() {}' > src/main.rs && \
echo 'fn main() {}' > src/bin/cli.rs && \
echo 'fn main() {}' > benches/engine.rs && \
cargo build --release --bin clob-api && \
rm -rf src benches
COPY src ./src
COPY benches ./benches
RUN touch src/main.rs && cargo build --release --bin clob-api
# ── Stage 2: runtime ──────────────────────────────────────────────────────────
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates tini \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/clob-api /usr/local/bin/clob-api
ENV RUST_LOG=info
EXPOSE 8080
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["clob-api"]