-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (17 loc) · 954 Bytes
/
Copy pathDockerfile
File metadata and controls
21 lines (17 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM rust:1.90 as builder
RUN apt-get update && apt install -y cmake
WORKDIR /usr/src/matrix-lightning-tip-bot
# Build dependencies first, cached independently of src/.
# Uses a stub main.rs so cargo resolves + compiles all deps based on Cargo.toml+lock.
COPY Cargo.toml Cargo.lock ./
COPY diesel.toml .
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release --locked
RUN rm -rf src target/release/matrix-lightning-tip-bot target/release/matrix-lightning-tip-bot.d \
&& find target/release/deps -name 'matrix_lightning_tip_bot*' -delete
# Now bring in the real sources and rebuild only our crate.
COPY src ./src
RUN cargo install --path . --locked
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates libssl-dev sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/cargo/bin/matrix-lightning-tip-bot /usr/local/bin/matrix-lightning-tip-bot