# Build stage FROM rust:1.75 as builder # Install system dependencies for OCR RUN apt-get update && apt-get install -y \ tesseract-ocr \ tesseract-ocr-eng \ libtesseract-dev \ libleptonica-dev \ pkg-config \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY Cargo.toml Cargo.lock ./ COPY src ./src RUN cargo build --release # Runtime stage FROM debian:bookworm-slim # Install runtime dependencies RUN apt-get update && apt-get install -y \ tesseract-ocr \ tesseract-ocr-eng \ ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy the binary COPY --from=builder /app/target/release/readur /app/readur # Create necessary directories RUN mkdir -p /app/uploads /app/watch /app/frontend # Copy frontend files (will be built separately) COPY frontend/dist /app/frontend EXPOSE 8000 CMD ["./readur"]