Update Dockerfile
Browse files- Dockerfile +5 -20
Dockerfile
CHANGED
@@ -1,29 +1,14 @@
|
|
1 |
# Use rocker/geospatial as the base image to include necessary geospatial libraries
|
2 |
FROM rocker/geospatial:latest
|
3 |
|
|
|
4 |
WORKDIR /code
|
5 |
|
6 |
-
# Install R packages
|
7 |
-
RUN
|
8 |
-
shiny \
|
9 |
-
shinydashboard \
|
10 |
-
dplyr \
|
11 |
-
readr \
|
12 |
-
sf \
|
13 |
-
cartogram \
|
14 |
-
ggplot2 \
|
15 |
-
rnaturalearth \
|
16 |
-
rnaturalearthdata \
|
17 |
-
countrycode \
|
18 |
-
DT \
|
19 |
-
ggExtra \
|
20 |
-
viridis
|
21 |
|
22 |
-
# Copy the
|
23 |
COPY . .
|
24 |
|
25 |
-
# Expose the port that Shiny will run on
|
26 |
-
EXPOSE 7860
|
27 |
-
|
28 |
# Run the Shiny app
|
29 |
-
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|
|
|
1 |
# Use rocker/geospatial as the base image to include necessary geospatial libraries
|
2 |
FROM rocker/geospatial:latest
|
3 |
|
4 |
+
# Set the working directory inside the container
|
5 |
WORKDIR /code
|
6 |
|
7 |
+
# Install required R packages, excluding suggested dependencies to avoid rnaturalearthhires error
|
8 |
+
RUN Rscript -e "install.packages(c('shiny', 'shinydashboard', 'dplyr', 'readr', 'sf', 'cartogram', 'ggplot2', 'rnaturalearth', 'rnaturalearthdata', 'countrycode', 'DT', 'ggExtra', 'viridis'), dependencies = c('Depends', 'Imports', 'LinkingTo'), repos = 'https://cran.r-project.org')"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
# Copy the current directory (containing app.R and data) into the container
|
11 |
COPY . .
|
12 |
|
|
|
|
|
|
|
13 |
# Run the Shiny app
|
14 |
+
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]
|