-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (43 loc) · 2.13 KB
/
Copy pathDockerfile
File metadata and controls
56 lines (43 loc) · 2.13 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
# syntax=docker/dockerfile:1
# ============ BUILD STAGE ============
FROM python:3.10-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential git git-lfs pkg-config clang libclang-dev \
zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev libssl-dev \
curl && rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install maturin with patchelf support
RUN pip install --no-cache-dir "maturin[patchelf]" uv
WORKDIR /build
# Copy project files (assumes LFS files are already checked out locally)
# If building from CI, ensure `git lfs pull` was run before docker build
COPY pyproject.toml README.md LICENSE ./
COPY rust/ rust/
COPY src/ src/
# Build the wheel
RUN maturin build --release --out /wheels --manifest-path rust/Cargo.toml
# ============ RUNTIME STAGE ============
FROM python:3.10-slim AS runtime
# OCI Labels for GitHub Container Registry
LABEL org.opencontainers.image.title="krewlyzer"
LABEL org.opencontainers.image.description="A comprehensive toolkit for ctDNA fragmentomics analysis from GRCh37 aligned BAM files"
LABEL org.opencontainers.image.url="https://github.com/msk-access/krewlyzer"
LABEL org.opencontainers.image.source="https://github.com/msk-access/krewlyzer"
LABEL org.opencontainers.image.vendor="MSK-ACCESS"
LABEL org.opencontainers.image.licenses="AGPL-3.0"
LABEL org.opencontainers.image.authors="Ronak Shah <shahr2@mskcc.org>"
# Runtime dependencies only (amd64 has pre-built wheels)
# procps and bash are required for Nextflow task metrics and shell execution
RUN apt-get update && apt-get install -y --no-install-recommends \
libcurl4 libssl3 zlib1g libbz2-1.0 liblzma5 \
procps bash && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /wheels/*.whl /tmp/
RUN pip install --no-cache-dir /tmp/*.whl && rm /tmp/*.whl
# Bundle data files (excluded from wheel to keep PyPI <100MB, but Docker includes them)
# Copy data to installed package location
COPY --from=builder /build/src/krewlyzer/data/ /usr/local/lib/python3.10/site-packages/krewlyzer/data/
ENTRYPOINT ["krewlyzer"]
CMD ["--help"]