-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile.worker
More file actions
24 lines (20 loc) · 841 Bytes
/
Dockerfile.worker
File metadata and controls
24 lines (20 loc) · 841 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
FROM lukemathwalker/cargo-chef:latest-rust-1.67.1-slim AS chef
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner recipe.json recipe.json
RUN apt-get update && apt-get install -y libudev-dev clang pkg-config libssl-dev build-essential cmake
RUN rustup component add rustfmt && update-ca-certificates
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release --bin worker
FROM debian:bullseye-slim as base_image
RUN apt-get update && apt-get -y install ca-certificates libssl1.1
# We do not need the Rust toolchain to run the binary!
FROM base_image AS runtime
COPY --from=builder /target/release/worker /usr/local/bin
COPY --from=builder markets.json .
COPY --from=builder ca.cer .
COPY --from=builder client.pks .