-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 768 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 768 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
28
29
30
# Multi-stage build for lean Docker image
FROM rust:1.88-slim AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy manifests
COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
# Build dependencies (this is the cached layer)
RUN cargo build --release --bin karakeep-sync
# Runtime stage - using distroless for minimal size
FROM gcr.io/distroless/cc-debian12
# Copy the binary from builder stage
COPY --from=builder /app/target/release/karakeep-sync /usr/local/bin/karakeep-sync
# Create non-root user (distroless already provides this)
USER nonroot:nonroot
# Set the binary as entrypoint
ENTRYPOINT ["karakeep-sync"]