This repository was archived by the owner on May 5, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
63 lines (47 loc) · 1.86 KB
/
Dockerfile
File metadata and controls
63 lines (47 loc) · 1.86 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Reproducible Build Environment for Presentar
# Ensures identical builds across all systems
#
# Build: docker build -t presentar .
# Run: docker run -it presentar cargo test
# Dev: docker run -it -v $(pwd):/app presentar bash
FROM rust:1.83.0-bookworm AS builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set reproducibility environment
ENV CARGO_INCREMENTAL=0
ENV RUSTFLAGS="-D warnings"
ENV RUST_BACKTRACE=1
# Create app directory
WORKDIR /app
# Copy dependency files first for caching
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY crates/*/Cargo.toml ./crates/
# Create dummy source files for dependency caching
RUN mkdir -p crates/presentar/src && echo "fn main() {}" > crates/presentar/src/lib.rs
RUN mkdir -p crates/presentar-terminal/src && echo "fn main() {}" > crates/presentar-terminal/src/lib.rs
RUN mkdir -p crates/presentar-core/src && echo "fn main() {}" > crates/presentar-core/src/lib.rs
RUN mkdir -p crates/presentar-test/src && echo "fn main() {}" > crates/presentar-test/src/lib.rs
RUN mkdir -p crates/presentar-test-macros/src && echo "fn main() {}" > crates/presentar-test-macros/src/lib.rs
RUN mkdir -p crates/presentar-yaml/src && echo "fn main() {}" > crates/presentar-yaml/src/lib.rs
# Build dependencies only
RUN cargo build --release 2>/dev/null || true
# Copy actual source
COPY . .
# Build the project
RUN cargo build --release
# Runtime image
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/ptop /usr/local/bin/
ENTRYPOINT ["ptop"]
# Development image
FROM builder AS development
# Install additional dev tools
RUN rustup component add rustfmt clippy
RUN cargo install cargo-llvm-cov cargo-nextest
CMD ["bash"]