stat-utas commited on
Commit
9e90fde
1 Parent(s): a058689

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -29
Dockerfile CHANGED
@@ -1,22 +1,9 @@
1
- # Stage 1: Base image for building
2
- FROM rocker/shiny:4.0.0 AS builder
3
-
4
- # Install git and openssh-client
5
- RUN apt-get update && apt-get install -y git openssh-client
6
-
7
- # Stage 2: Final image
8
  FROM rocker/shiny:4.0.0
9
 
10
- # Copy installed packages from builder stage
11
- COPY --from=builder /usr/local/lib/R/site-library/ /usr/local/lib/R/site-library/
12
-
13
- # Copy installed system packages from builder stage
14
- COPY --from=builder /var/lib/apt/lists/ /var/lib/apt/lists/
15
-
16
- # Set up working directory
17
  WORKDIR /srv/shiny-server/app
18
 
19
- # Install additional R packages
 
20
  RUN install2.r --error \
21
  shiny \
22
  auth0 \
@@ -26,24 +13,15 @@ RUN install2.r --error \
26
  zoo \
27
  dplyr
28
 
29
- # Arguments
30
  ARG UN
31
  ARG FILE
32
- ARG PAT
33
-
34
- # Create SSH directory
35
- RUN mkdir -p /root/.ssh
36
-
37
- # Copy the SSH private key into the container
38
- RUN echo "$PAT" > /root/.ssh/id_rsa \
39
- && chmod 600 /root/.ssh/id_rsa \
40
- && ssh-keyscan github.com >> /root/.ssh/known_hosts
41
 
42
- # Clone the repository using SSH
43
- RUN git clone git@github.com:${UN}/${FILE}.git /srv/shiny-server/app
44
 
45
- # Set Auth0 config file path
46
  RUN echo "options(auth0_find_config_file = '/srv/shiny-server/app/_auth0.yml')" > /usr/local/lib/R/etc/Rprofile.site
47
 
48
- # Set command to run the Shiny app
49
  CMD ["R", "-e", "shiny::runApp('.', host='0.0.0.0', port=7860)"]
 
 
 
 
 
 
 
 
1
  FROM rocker/shiny:4.0.0
2
 
 
 
 
 
 
 
 
3
  WORKDIR /srv/shiny-server/app
4
 
5
+ RUN apt-get update && apt-get install -y git
6
+
7
  RUN install2.r --error \
8
  shiny \
9
  auth0 \
 
13
  zoo \
14
  dplyr
15
 
16
+ ARG PAT
17
  ARG UN
18
  ARG FILE
19
+ ENV PAT=${PAT}
20
+ ENV UN=${UN}
21
+ ENV FILE=${FILE}
 
 
 
 
 
 
22
 
23
+ RUN git clone https://${UN}:${PAT}@github.com/${UN}/${FILE}.git /srv/shiny-server/app
 
24
 
 
25
  RUN echo "options(auth0_find_config_file = '/srv/shiny-server/app/_auth0.yml')" > /usr/local/lib/R/etc/Rprofile.site
26
 
 
27
  CMD ["R", "-e", "shiny::runApp('.', host='0.0.0.0', port=7860)"]