PtteMDataScience commited on
Commit
5123412
1 Parent(s): 071e8ec

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -0
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use R Shiny image
2
+ FROM rocker/shiny:latest
3
+
4
+ # Install necessary Linux dependencies
5
+ # CMake and libnlopt-dev added for nloptr
6
+ RUN apt-get update && apt-get install -y \
7
+ libcurl4-gnutls-dev \
8
+ libssl-dev \
9
+ libxml2-dev \
10
+ libudunits2-dev \
11
+ libgdal-dev \
12
+ libcairo2-dev \
13
+ libxt-dev \
14
+ libpq-dev \
15
+ libssh2-1-dev \
16
+ libharfbuzz-dev \
17
+ libfribidi-dev \
18
+ libgsl0-dev \
19
+ cmake \
20
+ libnlopt-dev \
21
+ libglpk-dev
22
+
23
+ # Clean up the apt cache to reduce the image size
24
+ RUN apt-get clean && \
25
+ rm -rf /var/lib/apt/lists/*
26
+
27
+ # Copy your application files
28
+ COPY . /usr/src/app
29
+
30
+ RUN chown -R shiny:shiny /usr/src/app
31
+
32
+ # Set the working directory
33
+ WORKDIR /usr/src/app
34
+
35
+ # Install renv and restore packages
36
+ RUN Rscript -e 'install.packages("renv")'
37
+ RUN Rscript -e 'renv::restore()'
38
+
39
+ # Expose the port the app runs on
40
+ EXPOSE 7860
41
+
42
+ CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]