-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (22 loc) · 712 Bytes
/
Dockerfile
File metadata and controls
25 lines (22 loc) · 712 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
FROM rustlang/rust:nightly-alpine AS chef
RUN apk add musl-dev
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY ./Cargo.toml ./Cargo.lock ./
COPY ./src ./src
RUN cargo chef prepare
FROM chef AS builder
RUN apk add openssl-libs-static openssl-dev
COPY --from=planner /app/recipe.json .
RUN cargo chef cook --release
COPY ./Cargo.toml ./Cargo.lock ./config_example.json ./
COPY ./src ./src
RUN cargo build --release
RUN mv ./target/release/rust-notifier ./program
FROM scratch AS runtime
WORKDIR /app
EXPOSE 3939
COPY --from=builder /app/program /app/config_example.json ./
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT ["/app/program"]