softwareDevelopment commited on
Commit
505fd6c
·
verified ·
1 Parent(s): e2e1359

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +83 -73
Dockerfile CHANGED
@@ -1,91 +1,101 @@
1
- FROM rocker/shiny:latest
2
 
3
- # Set working directory inside container
4
- WORKDIR /code
 
5
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  libcurl4-openssl-dev \
9
  libssl-dev \
10
  libxml2-dev \
11
- libnlopt-dev \
12
- libicu-dev \
13
- libgdal-dev \
14
- libgeos-dev \
15
- libproj-dev \
16
- libv8-dev \
17
- libnode-dev \
18
- libglpk-dev \
19
- libglpk40 \
 
 
 
 
 
 
 
 
 
 
20
  && apt-get clean \
21
  && rm -rf /var/lib/apt/lists/*
22
 
23
- # Install pak and remotes first (needed for GitHub installs)
24
- RUN install2.r --error remotes pak
 
 
 
 
 
 
 
 
25
 
26
- # Install htmlwidgets and related dependencies
27
- RUN install2.r --error \
28
- htmltools \
29
- htmlwidgets \
30
- jsonlite \
31
- crosstalk \
32
- magrittr \
33
- promises \
34
- ellmer \
35
- shinychat \
36
- text2vec \
37
- Matrix \
38
- shinydashboard \
39
- circlize \
40
- ComplexHeatmap \
41
- RColorBrewer \
42
- car \
43
- mgcv \
44
- e1071 \
45
- KernSmooth \
46
- splines \
47
- foreach \
48
- doParallel
49
-
50
-
51
 
52
- # Install main packages
53
- RUN install2.r --error \
54
- nloptr \
55
- lme4 \
56
- emmeans \
57
- readxl \
58
- plotly \
59
- shinyjs \
60
- shinyWidgets \
61
- DT \
62
- RColorBrewer \
63
- ggrepel \
64
- openxlsx \
65
- randomForest \
66
- caret \
67
- qtl \
68
- writexl \
69
- viridis \
70
- devtools \
71
- tidyverse \
72
- igraph \
73
- vcfR \
74
- poppr \
75
- reshape2
76
 
77
- # Install packages from GitHub using pak (modern replacement for devtools::install_github)
78
- RUN R -e "pak::pak('cran/qtlDesign')" \
79
- && R -e "pak::pak('jtlovell/qtlTools')"
 
80
 
81
- # Create www directory and health file
82
- RUN mkdir -p /code/www && echo "OK" > /code/www/health
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
- # Copy app code
85
- COPY app.R /code/
 
86
 
87
- # Expose the port Shiny will run on
88
  EXPOSE 7860
89
 
90
- # Run the app
91
- CMD ["R", "--quiet", "-e", "shiny::runApp('/code', host='0.0.0.0', port=7860)"]
 
 
1
 
2
+
3
+ # Use R Studio's Rocker image with Shiny Server for Hugging Face
4
+ FROM rocker/shiny:4.3.1
5
 
6
  # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  libcurl4-openssl-dev \
9
  libssl-dev \
10
  libxml2-dev \
11
+ libfontconfig1-dev \
12
+ libharfbuzz-dev \
13
+ libfribidi-dev \
14
+ libfreetype6-dev \
15
+ libpng-dev \
16
+ libtiff5-dev \
17
+ libjpeg-dev \
18
+ libcairo2-dev \
19
+ libxt-dev \
20
+ libx11-dev \
21
+ libxext-dev \
22
+ libmagick++-dev \
23
+ libgit2-dev \
24
+ libssh2-1-dev \
25
+ libpoppler-cpp-dev \
26
+ vim \
27
+ curl \
28
+ wget \
29
+ git \
30
  && apt-get clean \
31
  && rm -rf /var/lib/apt/lists/*
32
 
33
+ # Install R packages
34
+ RUN R -e "install.packages(c('shiny', 'shinydashboard', 'DT', 'ggplot2', 'plotly', 'dplyr', 'tidyr'), repos='https://cloud.r-project.org/')"
35
+
36
+ RUN R -e "install.packages(c('circlize', 'ComplexHeatmap', 'RColorBrewer', 'car', 'lme4', 'mgcv'), repos='https://cloud.r-project.org/')"
37
+
38
+ RUN R -e "install.packages(c('randomForest', 'e1071', 'gbm', 'KernSmooth', 'splines', 'foreach', 'doParallel', 'Matrix'), repos='https://cloud.r-project.org/')"
39
+
40
+ RUN R -e "install.packages(c('htmltools', 'htmlwidgets', 'jsonlite', 'crosstalk', 'magrittr', 'promises'), repos='https://cloud.r-project.org/')"
41
+
42
+ RUN R -e "install.packages(c('qtl', 'qqman'), repos='https://cloud.r-project.org/')"
43
 
44
+ # Install Bioconductor packages
45
+ RUN R -e "if (!require('BiocManager', quietly = TRUE)) install.packages('BiocManager')"
46
+ RUN R -e "BiocManager::install(c('GenomicRanges', 'IRanges'), ask=FALSE, update=FALSE)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ # Create app directory
49
+ RUN mkdir -p /home/shiny/app
50
+ RUN mkdir -p /home/shiny/data
51
+ RUN mkdir -p /home/shiny/logs
52
+ RUN mkdir -p /home/shiny/reports
53
+ RUN mkdir -p /home/shiny/app/www
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
+ # Copy app files
56
+ COPY app.R /home/shiny/app/
57
+ COPY www/ /home/shiny/app/www/
58
+ COPY data/ /home/shiny/data/
59
 
60
+ # Configure Shiny Server for Hugging Face
61
+ RUN echo '\
62
+ # Shiny Server Configuration\n\
63
+ run_as shiny;\n\
64
+ \n\
65
+ server {\n\
66
+ listen 7860;\n\
67
+ \n\
68
+ location / {\n\
69
+ app_dir /home/shiny/app;\n\
70
+ \n\
71
+ # Increase timeouts for QTL analysis\n\
72
+ app_init_timeout 120;\n\
73
+ app_idle_timeout 600;\n\
74
+ \n\
75
+ # Allow large file uploads (50MB)\n\
76
+ max_request_size 50M;\n\
77
+ \n\
78
+ # Preserve logs\n\
79
+ preserve_logs true;\n\
80
+ }\n\
81
+ \n\
82
+ # Static files\n\
83
+ location /www {\n\
84
+ alias /home/shiny/app/www;\n\
85
+ }\n\
86
+ \n\
87
+ location /data {\n\
88
+ alias /home/shiny/data;\n\
89
+ }\n\
90
+ }\n\
91
+ ' > /etc/shiny-server/shiny-server.conf
92
 
93
+ # Set permissions
94
+ RUN chown -R shiny:shiny /home/shiny
95
+ RUN chmod -R 755 /home/shiny
96
 
97
+ # Expose Hugging Face default port
98
  EXPOSE 7860
99
 
100
+ # Start Shiny Server
101
+ CMD ["/usr/bin/shiny-server"]