2023-09-15 10:11:45 +00:00
|
|
|
FROM rust:1.72-slim-bullseye AS builder
|
|
|
|
|
|
|
|
WORKDIR /bebot-build
|
|
|
|
|
2023-09-16 07:06:13 +00:00
|
|
|
# Build and cache dependencies
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
RUN mkdir -p src && echo 'fn main() {}' > src/main.rs
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
# Build and link our app
|
|
|
|
RUN rm -rf src
|
|
|
|
COPY src ./src
|
|
|
|
RUN touch src/main.rs
|
2023-09-15 10:11:45 +00:00
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
|
|
|
|
WORKDIR /bebot
|
|
|
|
|
|
|
|
COPY --from=builder /bebot-build/target/release/bebot ./
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/bebot/bebot", "/bebot/config/bebot.yaml" ]
|