aephidayatuloh commited on
Commit
01cdcc3
1 Parent(s): c667395

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -1,6 +1,13 @@
1
  # Generated by the vetiver package; edit with care
2
 
3
  FROM rocker/r-ver:4.4.0
 
 
 
 
 
 
 
4
 
5
  RUN apt-get update -qq && apt-get install -y --no-install-recommends \
6
  libcurl4-openssl-dev \
@@ -11,23 +18,15 @@ RUN apt-get update -qq && apt-get install -y --no-install-recommends \
11
  zlib1g-dev \
12
  && apt-get clean
13
 
14
- COPY vetiver_renv.lock renv.lock
15
-
16
- # create a non-root user to run the app
17
- RUN useradd --create-home appuser
18
-
19
- ENV RENV_CONFIG_REPOS_OVERRIDE https://packagemanager.rstudio.com/cran/latest
20
- ENV HOME=/home/appuser
21
- WORKDIR $HOME
22
-
23
  # Create the .cache directory and give appuser permission to write to it
24
  RUN mkdir -p /home/appuser/.cache && chown -R appuser:appuser /home/appuser/.cache
25
  # Create the .cache/pins/url directory and give appuser permission to write to it
26
  RUN mkdir -p /home/appuser/.cache/pins/url && chown -R appuser:appuser /home/appuser/.cache/pins/url
27
 
 
 
28
  RUN Rscript -e "install.packages('renv')"
29
  RUN Rscript -e "renv::restore()"
30
  COPY plumber.R /opt/ml/plumber.R
31
- COPY telco/ /opt/ml/telco/
32
  EXPOSE 7860
33
  ENTRYPOINT ["R", "-e", "pr <- plumber::plumb('/opt/ml/plumber.R'); pr$run(host = '0.0.0.0', port = 7860)"]
 
1
  # Generated by the vetiver package; edit with care
2
 
3
  FROM rocker/r-ver:4.4.0
4
+ ENV RENV_CONFIG_REPOS_OVERRIDE https://packagemanager.rstudio.com/cran/latest
5
+
6
+ # create a non-root user to run the app
7
+ RUN useradd --create-home appuser
8
+
9
+ ENV HOME=/home/appuser
10
+ WORKDIR $HOME
11
 
12
  RUN apt-get update -qq && apt-get install -y --no-install-recommends \
13
  libcurl4-openssl-dev \
 
18
  zlib1g-dev \
19
  && apt-get clean
20
 
 
 
 
 
 
 
 
 
 
21
  # Create the .cache directory and give appuser permission to write to it
22
  RUN mkdir -p /home/appuser/.cache && chown -R appuser:appuser /home/appuser/.cache
23
  # Create the .cache/pins/url directory and give appuser permission to write to it
24
  RUN mkdir -p /home/appuser/.cache/pins/url && chown -R appuser:appuser /home/appuser/.cache/pins/url
25
 
26
+ COPY /telco/ /opt/ml/telco/
27
+ COPY vetiver_renv.lock renv.lock
28
  RUN Rscript -e "install.packages('renv')"
29
  RUN Rscript -e "renv::restore()"
30
  COPY plumber.R /opt/ml/plumber.R
 
31
  EXPOSE 7860
32
  ENTRYPOINT ["R", "-e", "pr <- plumber::plumb('/opt/ml/plumber.R'); pr$run(host = '0.0.0.0', port = 7860)"]