automattic-harper
SUCCESS
54m 38s
History Source
SummaryIterations1Transcript20Dockerfile
Dockerfile26 lines · 759 chars
# Minimal Dockerfile to build harper-cli from source and provide a runnable image

FROM rust:1.76 AS builder
WORKDIR /workspace

# Cache-busting: copy only manifest first, if possible; here we copy everything for simplicity
COPY . .

# Build only the harper-cli binary from the workspace
RUN cargo build -p harper-cli --release

FROM debian:bookworm-slim AS runtime

# Install minimal runtime dependencies
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

# Copy the built binary from the builder stage and name it t harper
COPY --from=builder /workspace/target/release/harper-cli /usr/local/bin/harper

RUN chmod +x /usr/local/bin/harper

WORKDIR /work

# Default command shows version/help
CMD ["harper", "--version"]