forked from StellarCommons/stellar-fee-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 854 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (20 loc) · 854 Bytes
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
# ---- Build stage ----
FROM rust:1.75-slim AS builder
WORKDIR /app
# Cache dependency compilation separately from source
COPY Cargo.toml Cargo.lock ./
COPY packages/core/Cargo.toml packages/core/Cargo.toml
# Create a stub main so cargo can compile dependencies
RUN mkdir -p packages/core/src && echo 'fn main() {}' > packages/core/src/main.rs
RUN cargo build --release --package core 2>/dev/null; true
# Build the real binary
COPY packages/core/src packages/core/src
RUN touch packages/core/src/main.rs && cargo build --release --package core
# ---- Runtime stage ----
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/core /usr/local/bin/stellar-fee-tracker
EXPOSE 8080
CMD ["stellar-fee-tracker"]