-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
101 lines (85 loc) · 3.11 KB
/
Dockerfile
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
100
101
# Dockerfile
FROM docker.io/rocker/r-ver:4.4.0
# System dependencies for R packages and rpy2
RUN apt-get update && apt-get install -y \
libxml2-dev \
libcurl4-openssl-dev \
libssl-dev \
libgraphviz-dev \
python3-pip \
python3-dev \
build-essential \
graphviz \
libpcre2-dev \
liblzma-dev \
libbz2-dev \
libicu-dev \
libtirpc-dev \
r-base-dev \
librsvg2-dev \
libcairo2-dev \
libgmp-dev \
libmpfr-dev \
libgsl-dev \
cmake \
nano \
&& rm -rf /var/lib/apt/lists/*
# Install BiocManager and its dependencies first
RUN R -e "install.packages(c('BiocManager', 'devtools'), repos='http://cran.rstudio.com/')"
# Install Bioconductor packages
RUN R -e "BiocManager::install(c('graph', 'Rgraphviz', 'RBGL'), ask=FALSE)"
# Install base dependencies first
RUN R -e "\
install.packages(c('ggm', 'sfsmisc', 'gmp', 'abind', 'corpcor', 'Rmpfr', 'V8'), \
repos='http://cran.rstudio.com/', \
dependencies=TRUE)"
# Install pcalg and its dependencies
RUN R -e "\
install.packages('pcalg', \
repos='http://cran.rstudio.com/', \
dependencies=TRUE)"
# Install rsvg and MXM with dependencies
RUN R -e "\
install.packages(c('rsvg', 'MXM'), \
repos='http://cran.rstudio.com/', \
dependencies=TRUE)"
# Install remaining R packages from requirements.r
COPY requirements.r /tmp/requirements.r
RUN R -e "packages <- readLines('/tmp/requirements.r'); \
installed_packages <- installed.packages()[,'Package']; \
packages <- setdiff(packages, installed_packages); \
if(length(packages) > 0) { \
install.packages(packages, \
repos='http://cran.rstudio.com/', \
dependencies=TRUE) \
}"
COPY install_mxm.r /tmp/install_mxm.r
RUN Rscript /tmp/install_mxm.r
# Install Python dependencies
RUN python3 -m pip install --upgrade pip setuptools wheel
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
# Copy project data
COPY ./imports /r-imports
WORKDIR /r-imports
# Install FCI Utils
RUN R CMD INSTALL /r-imports/FCI.Utils_1.0.tar.gz
# Install rIOD
RUN R CMD INSTALL /r-imports/rIOD_1.0.tar.gz
WORKDIR /
RUN rm -r /r-imports
# ,------. ,--. ,--. ,------. ,--.
# | .--. ',--. ,--.,-' '-.| ,---. ,---. ,--,--, | .--. ' ,--,--. ,---.| |,-. ,--,--. ,---. ,---. ,---.
# | '--' | \ ' / '-. .-'| .-. || .-. || \ | '--' |' ,-. || .--'| /' ,-. || .-. || .-. :( .-'
# | | --' \ ' | | | | | |' '-' '| || | | | --' \ '-' |\ `--.| \ \\ '-' |' '-' '\ --..-' `)
# `--' .-' / `--' `--' `--' `---' `--''--' `--' `--`--' `---'`--'`--'`--`--'.`- / `----'`----'
# `---' `---'
COPY ./app /app
WORKDIR /app
# More Python packages
RUN pip install pandas polars graphviz rpy2 litestar[standard] streamlit extra-streamlit-components streamlit-extras streamlit-autorefresh
RUN pip install statsmodels scipy
# make startup script executable
RUN chmod +x startup.sh
# Draws config from env vars
CMD ./startup.sh