ucii commited on
Commit
8f977d2
1 Parent(s): fadd432

upload dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # --------------- Tambahkan bagian berikut secara manual ke Dockerfile ------------------- #
7
+ # create a non-root user to run the app
8
+ RUN useradd --create-home appuser
9
+
10
+ ENV HOME=/home/appuser
11
+ WORKDIR $HOME
12
+
13
+ # Create the .cache directory and give appuser permission to write to it
14
+ RUN mkdir -p /home/appuser/.cache && chown -R appuser:appuser /home/appuser/.cache
15
+ # Create the .cache/pins/url directory and give appuser permission to write to it
16
+ RUN mkdir -p /home/appuser/.cache/pins/url && chown -R appuser:appuser /home/appuser/.cache/pins/url
17
+
18
+ COPY /PasienCHD/ /opt/ml/PasienCHD/
19
+
20
+ RUN apt-get update -qq && apt-get install -y --no-install-recommends \
21
+ libcurl4-openssl-dev \
22
+ libicu-dev \
23
+ libsodium-dev \
24
+ libssl-dev \
25
+ make \
26
+ zlib1g-dev \
27
+ && apt-get clean
28
+
29
+ COPY vetiver_renv.lock renv.lock
30
+ RUN Rscript -e "install.packages('renv')"
31
+ RUN Rscript -e "renv::restore()"
32
+ COPY plumber.R /opt/ml/plumber.R
33
+ EXPOSE 7860
34
+ ENTRYPOINT ["R", "-e", "pr <- plumber::plumb('/opt/ml/plumber.R'); pr$run(host = '0.0.0.0', port = 7860)"]