-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.search
More file actions
99 lines (84 loc) · 4.41 KB
/
Dockerfile.search
File metadata and controls
99 lines (84 loc) · 4.41 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# =============================================================================
# Dockerfile.search — DE-LIMP with embedded DIA-NN for local searching
# =============================================================================
# Multi-stage build: copies DIA-NN from user's pre-built image into DE-LIMP.
# Requires: diann:2.0 image (build with build_diann_docker.sh first)
#
# Usage:
# docker compose up (recommended — uses docker-compose.yml)
# docker build -f Dockerfile.search -t delimp-search .
# =============================================================================
# Stage 1: Get DIA-NN binaries from user's pre-built image
FROM diann:2.0 AS diann
# Stage 2: DE-LIMP app with DIA-NN embedded
FROM rocker/shiny:4.5.0
# 1. System dependencies (same as base Dockerfile + wget for .NET install)
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libcairo2-dev \
libxt-dev \
cmake \
openssh-client \
wget \
&& rm -rf /var/lib/apt/lists/*
# 2. CRAN packages
# Install arrow with full codec support (zstd needed for parquet files)
ENV LIBARROW_MINIMAL=false
RUN R -e "install.packages(c('bslib', 'readr', 'tibble', 'dplyr', 'tidyr', 'ggplot2', 'httr2', 'rhandsontable', 'DT', 'arrow', 'shinyjs', 'plotly', 'stringr', 'ggrepel', 'remotes', 'BiocManager', 'markdown', 'shinyFiles', 'jsonlite', 'processx', 'callr'), repos='https://cloud.r-project.org/')"
RUN R -e "install.packages(c('KSEAapp', 'ggseqlogo', 'ggdendro'), repos='https://cloud.r-project.org/')"
RUN R -e "install.packages(c('systemfonts', 'gdtools', 'Rcpp'), repos='https://cloud.r-project.org/')"
RUN R -e "install.packages(c('ggraph', 'graphlayouts', 'tidygraph', 'scatterpie', 'shadowtext', 'ggforce'), repos='https://cloud.r-project.org/')"
# Core Facility mode packages (SQLite, YAML, UUID, Quarto rendering)
RUN R -e "install.packages(c('DBI', 'RSQLite', 'yaml', 'uuid', 'quarto'), repos='https://cloud.r-project.org/')"
# 3. Bioconductor packages
RUN R -e "BiocManager::install(c('DOSE', 'GOSemSim', 'yulab.utils'), ask=FALSE, update=FALSE)"
RUN R -e "BiocManager::install(c('limma', 'limpa', 'ComplexHeatmap', 'AnnotationDbi', 'org.Hs.eg.db', 'org.Mm.eg.db', 'ggridges'), ask=FALSE, update=FALSE)"
RUN R -e "BiocManager::install(c('ggtree', 'ggtangle'), ask=FALSE, update=FALSE)"
RUN R -e "BiocManager::install(c('clusterProfiler', 'enrichplot'), ask=FALSE, update=FALSE)"
# MOFA2 + basilisk (Python env managed by basilisk for mofapy2)
RUN R -e "BiocManager::install(c('MOFA2', 'basilisk'), ask=FALSE, update=FALSE)"
# Pre-initialize basilisk env so first MOFA run doesn't need to download Python
RUN R -e "library(MOFA2); basilisk::basiliskStart(MOFA2:::mofa_env) |> basilisk::basiliskStop()" 2>/dev/null || true
# 4. Copy DIA-NN binaries + shared libraries from Stage 1
COPY --from=diann /opt/diann/ /opt/diann/
RUN chmod +x /opt/diann/diann-linux 2>/dev/null || true && \
ln -sf /opt/diann/diann-linux /usr/local/bin/diann
ENV LD_LIBRARY_PATH="/opt/diann:${LD_LIBRARY_PATH}"
# 5. Install .NET SDK 8.0 (DIA-NN needs this for Thermo .raw file reading)
RUN wget -q https://dot.net/v1/dotnet-install.sh -O /tmp/dotnet-install.sh && \
chmod +x /tmp/dotnet-install.sh && \
/tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet && \
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet && \
rm /tmp/dotnet-install.sh
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH="$PATH:/usr/share/dotnet"
# 6. Copy DE-LIMP app
COPY app.R /srv/shiny-server/app.R
COPY R/ /srv/shiny-server/R/
COPY contaminants/ /srv/shiny-server/contaminants/
COPY VERSION /srv/shiny-server/VERSION
COPY stats/ /srv/shiny-server/stats/
# 7. Create data mount point with subdirectories
RUN mkdir -p /data/raw /data/fasta /data/output
# 8. Environment: signal to app.R that we're in Docker with local DIA-NN
ENV DELIMP_DATA_DIR=/data
EXPOSE 3838
# Entrypoint: fix SSH key permissions (Windows mounts give 777 which SSH rejects)
# then start the Shiny app
CMD ["bash", "-c", "\
if [ -d /data/ssh ]; then \
mkdir -p /tmp/.ssh && \
cp /data/ssh/* /tmp/.ssh/ 2>/dev/null; \
chmod 600 /tmp/.ssh/* 2>/dev/null; \
export DELIMP_SSH_KEY=$(ls /tmp/.ssh/* 2>/dev/null | grep -v gitkeep | head -1); \
fi && \
R -e \"shiny::runApp('/srv/shiny-server/', host='0.0.0.0', port=3838)\""]