Spaces:
Sleeping
Sleeping
update dockerfile
Browse files- Dockerfile +33 -7
Dockerfile
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
|
|
| 1 |
FROM rocker/r-base:latest
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /code
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
COPY . .
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|
|
|
|
| 1 |
+
# Use a Rocker base image with R installed
|
| 2 |
FROM rocker/r-base:latest
|
| 3 |
|
| 4 |
+
# Set working directory inside the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# Install system dependencies for R packages
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
libcurl4-openssl-dev \
|
| 10 |
+
libssl-dev \
|
| 11 |
+
libxml2-dev \
|
| 12 |
+
libgit2-dev \
|
| 13 |
+
libgdal-dev \
|
| 14 |
+
libgeos-dev \
|
| 15 |
+
libproj-dev \
|
| 16 |
+
libudunits2-dev \
|
| 17 |
+
libfontconfig1-dev \
|
| 18 |
+
libfreetype6-dev \
|
| 19 |
+
libpng-dev \
|
| 20 |
+
libtiff5-dev \
|
| 21 |
+
libjpeg-dev \
|
| 22 |
+
wget \
|
| 23 |
+
curl \
|
| 24 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
+
|
| 26 |
+
# Install R packages from CRAN
|
| 27 |
+
RUN R -e "install.packages(c('shiny', 'dplyr', 'leaflet', 'RColorBrewer', 'scales', 'lattice', 'plotly', 'bslib', 'shinydashboard', 'remotes'), repos='https://cloud.r-project.org')"
|
| 28 |
+
|
| 29 |
+
# Install GitHub packages using remotes
|
| 30 |
+
RUN R -e "remotes::install_github('briatte/ggnet')"
|
| 31 |
+
RUN R -e "remotes::install_github('rspatial/terra')"
|
| 32 |
+
|
| 33 |
+
# Copy the app code into the container
|
| 34 |
COPY . .
|
| 35 |
|
| 36 |
+
# Expose port 7860 for Shiny
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Run the Shiny app
|
| 40 |
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|