-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (22 loc) · 749 Bytes
/
Dockerfile
File metadata and controls
27 lines (22 loc) · 749 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
26
27
FROM rust:1.95.0-alpine3.22 AS base
WORKDIR /app
RUN apk add --no-cache musl-dev \
&& cargo install cargo-chef
FROM base AS src
COPY Cargo.toml Cargo.lock ./
COPY src/ ./src/
COPY tests/ ./tests/
FROM src AS test
RUN cargo check \
&& cargo test
FROM src AS planner
RUN cargo chef prepare --recipe-path recipe.json
FROM src AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY Cargo.toml Cargo.lock ./
COPY src/ ./src/
RUN cargo build --release --target x86_64-unknown-linux-musl
FROM alpine:3.23
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/github-profile-toolbox /usr/local/bin/
ENTRYPOINT ["github-profile-toolbox"]