softwareDevelopment commited on
Commit
e784f8d
·
verified ·
1 Parent(s): d02ddbd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -34
Dockerfile CHANGED
@@ -1,11 +1,7 @@
1
- # =============================================================================
2
- # QTL Mapper Pro — Optimized Dockerfile (OOM FIXED)
3
- # =============================================================================
4
-
5
  FROM rocker/shiny:4.3.2
6
 
7
  # -----------------------------------------------------------------------------
8
- # 1. Minimal system dependencies (reduce memory load)
9
  # -----------------------------------------------------------------------------
10
  RUN apt-get update && apt-get install -y \
11
  libcurl4-openssl-dev \
@@ -18,65 +14,55 @@ RUN apt-get update && apt-get install -y \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
  # -----------------------------------------------------------------------------
21
- # 2. Set CRAN mirror (faster + stable)
22
  # -----------------------------------------------------------------------------
23
  RUN echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" \
24
  >> /usr/local/lib/R/etc/Rprofile.site
25
 
26
  # -----------------------------------------------------------------------------
27
- # 3. Install R packages in SMALL GROUPS (prevents OOM)
28
  # -----------------------------------------------------------------------------
29
-
30
- # Core
31
  RUN R -e "install.packages('shiny')"
32
 
33
- # Data + plotting
34
  RUN R -e "install.packages(c('ggplot2','dplyr','tidyr','scales'))"
35
 
36
- # Tables + interactivity
37
- RUN R -e "install.packages(c('DT'))"
38
-
39
- # Optional (comment if still OOM)
40
- RUN R -e "install.packages('plotly')"
41
 
42
- # QTL package (important)
43
  RUN R -e "install.packages('qtl')"
44
 
45
- # UI helpers (lightweight)
46
  RUN R -e "install.packages(c('shinyWidgets','shinyjs','shinycssloaders'))"
47
 
48
- # Colors
49
  RUN R -e "install.packages(c('viridis','RColorBrewer'))"
50
 
 
 
 
51
  # -----------------------------------------------------------------------------
52
- # 4. Copy app
53
  # -----------------------------------------------------------------------------
54
  COPY app.R /srv/shiny-server/app.R
55
 
56
- # -----------------------------------------------------------------------------
57
- # 5. Fix permissions
58
- # -----------------------------------------------------------------------------
59
  RUN chown -R shiny:shiny /srv/shiny-server
60
 
61
  # -----------------------------------------------------------------------------
62
- # 6. Shiny server config (port 7860 for HF)
63
  # -----------------------------------------------------------------------------
64
- RUN echo "run_as shiny;
65
- server {
66
- listen 7860;
67
- location / {
68
- site_dir /srv/shiny-server;
69
- log_dir /var/log/shiny-server;
70
- directory_index on;
71
- }
72
- }" > /etc/shiny-server/shiny-server.conf
73
 
74
  # -----------------------------------------------------------------------------
75
- # 7. Expose port
76
  # -----------------------------------------------------------------------------
77
  EXPOSE 7860
78
 
79
  # -----------------------------------------------------------------------------
80
- # 8. Run app
81
  # -----------------------------------------------------------------------------
82
  CMD ["/usr/bin/shiny-server"]
 
 
 
 
 
1
  FROM rocker/shiny:4.3.2
2
 
3
  # -----------------------------------------------------------------------------
4
+ # System dependencies
5
  # -----------------------------------------------------------------------------
6
  RUN apt-get update && apt-get install -y \
7
  libcurl4-openssl-dev \
 
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # -----------------------------------------------------------------------------
17
+ # CRAN mirror
18
  # -----------------------------------------------------------------------------
19
  RUN echo "options(repos = c(CRAN = 'https://cloud.r-project.org'))" \
20
  >> /usr/local/lib/R/etc/Rprofile.site
21
 
22
  # -----------------------------------------------------------------------------
23
+ # Install R packages (small groups → avoid OOM)
24
  # -----------------------------------------------------------------------------
 
 
25
  RUN R -e "install.packages('shiny')"
26
 
 
27
  RUN R -e "install.packages(c('ggplot2','dplyr','tidyr','scales'))"
28
 
29
+ RUN R -e "install.packages('DT')"
 
 
 
 
30
 
 
31
  RUN R -e "install.packages('qtl')"
32
 
 
33
  RUN R -e "install.packages(c('shinyWidgets','shinyjs','shinycssloaders'))"
34
 
 
35
  RUN R -e "install.packages(c('viridis','RColorBrewer'))"
36
 
37
+ # OPTIONAL (comment if memory issue)
38
+ RUN R -e "install.packages('plotly')"
39
+
40
  # -----------------------------------------------------------------------------
41
+ # Copy app
42
  # -----------------------------------------------------------------------------
43
  COPY app.R /srv/shiny-server/app.R
44
 
 
 
 
45
  RUN chown -R shiny:shiny /srv/shiny-server
46
 
47
  # -----------------------------------------------------------------------------
48
+ # FIXED Shiny config (IMPORTANT)
49
  # -----------------------------------------------------------------------------
50
+ RUN printf "run_as shiny;\n\
51
+ server {\n\
52
+ listen 7860;\n\
53
+ location / {\n\
54
+ site_dir /srv/shiny-server;\n\
55
+ log_dir /var/log/shiny-server;\n\
56
+ directory_index on;\n\
57
+ }\n\
58
+ }\n" > /etc/shiny-server/shiny-server.conf
59
 
60
  # -----------------------------------------------------------------------------
61
+ # Port
62
  # -----------------------------------------------------------------------------
63
  EXPOSE 7860
64
 
65
  # -----------------------------------------------------------------------------
66
+ # Run app
67
  # -----------------------------------------------------------------------------
68
  CMD ["/usr/bin/shiny-server"]