Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -62
Dockerfile
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 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
|
|
@@ -8,94 +6,39 @@ 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
|
| 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
|
| 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"]
|
|
|
|
| 1 |
+
# Simplified Dockerfile for Hugging Face without data directory
|
|
|
|
|
|
|
| 2 |
FROM rocker/shiny:4.3.1
|
| 3 |
|
| 4 |
# Install system dependencies
|
|
|
|
| 6 |
libcurl4-openssl-dev \
|
| 7 |
libssl-dev \
|
| 8 |
libxml2-dev \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
libcairo2-dev \
|
| 10 |
libxt-dev \
|
|
|
|
|
|
|
| 11 |
libmagick++-dev \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
curl \
|
|
|
|
|
|
|
| 13 |
&& apt-get clean \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Install R packages (minimal set for Hugging Face)
|
| 17 |
+
RUN R -e "install.packages(c('shiny', 'shinydashboard', 'DT', 'ggplot2', 'plotly', 'dplyr', 'tidyr', 'RColorBrewer', 'car', 'lme4', 'mgcv', 'randomForest', 'e1071', 'qtl'), repos='https://cloud.r-project.org/')"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Create app directory
|
| 20 |
RUN mkdir -p /home/shiny/app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# Copy only the app.R file
|
| 23 |
COPY app.R /home/shiny/app/
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
# Configure Shiny Server
|
| 26 |
RUN echo '\
|
|
|
|
| 27 |
run_as shiny;\n\
|
|
|
|
| 28 |
server {\n\
|
| 29 |
listen 7860;\n\
|
|
|
|
| 30 |
location / {\n\
|
| 31 |
app_dir /home/shiny/app;\n\
|
|
|
|
|
|
|
| 32 |
app_init_timeout 120;\n\
|
| 33 |
app_idle_timeout 600;\n\
|
|
|
|
|
|
|
| 34 |
max_request_size 50M;\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
}\n\
|
| 36 |
}\n\
|
| 37 |
' > /etc/shiny-server/shiny-server.conf
|
| 38 |
|
| 39 |
# Set permissions
|
| 40 |
RUN chown -R shiny:shiny /home/shiny
|
|
|
|
| 41 |
|
|
|
|
| 42 |
EXPOSE 7860
|
| 43 |
|
|
|
|
| 44 |
CMD ["/usr/bin/shiny-server"]
|