cjerzak commited on
Commit
e505df7
·
verified ·
1 Parent(s): 07f710b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,17 +1,16 @@
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, specifying the CRAN repository for reliability.
8
- # Note: "cartogram" has been removed to avoid the dependency error for rnaturalearthhires.
9
- RUN install2.r --error --deps TRUE --repos "https://cran.r-project.org" \
10
  shiny \
11
  shinydashboard \
12
  dplyr \
13
  readr \
14
  sf \
 
15
  ggplot2 \
16
  rnaturalearth \
17
  rnaturalearthdata \
@@ -20,11 +19,11 @@ RUN install2.r --error --deps TRUE --repos "https://cran.r-project.org" \
20
  ggExtra \
21
  viridis
22
 
23
- # Copy all files from the current directory to the container's working directory
24
  COPY . .
25
 
26
- # Expose port 7860 to allow external access to the Shiny app
27
  EXPOSE 7860
28
 
29
- # Command to run the Shiny app when the container starts
30
- 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
  WORKDIR /code
5
 
6
+ # Install R packages but limit dependencies to required ones (skipping suggested packages like rnaturalearthhires)
7
+ RUN install2.r --error --deps 'Depends,Imports,LinkingTo' --repos "https://cran.r-project.org" \
 
8
  shiny \
9
  shinydashboard \
10
  dplyr \
11
  readr \
12
  sf \
13
+ cartogram \
14
  ggplot2 \
15
  rnaturalearth \
16
  rnaturalearthdata \
 
19
  ggExtra \
20
  viridis
21
 
22
+ # Copy the application code into the container
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)"]