-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (25 loc) · 964 Bytes
/
Dockerfile
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
38
39
40
41
42
43
FROM rust:1-slim-bookworm AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y
RUN cargo install cargo-chef
FROM base AS planner
WORKDIR /usr/local/src/embedbot-rs
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY src src
RUN cargo chef prepare --recipe-path recipe.json
FROM base AS builder
WORKDIR /usr/local/src/embedbot-rs
COPY --from=planner /usr/local/src/embedbot-rs/recipe.json recipe.json
RUN cargo chef cook --recipe-path recipe.json --release
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY src src
RUN cargo build --release
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y && apt-get install ca-certificates chromium -y
COPY embedbot.toml /etc/embedbot.json
COPY --from=builder /usr/local/src/embedbot-rs/target/release/embedbot-rs /usr/local/bin/
RUN chmod +x /usr/local/bin/embedbot-rs
ENTRYPOINT ["/usr/local/bin/embedbot-rs"]