aephidayatuloh commited on
Commit
487321a
·
1 Parent(s): 2f541b2

upload dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 /telco/ /opt/ml/telco/
19
+
20
+ # --------------------------------- akhir bagian ----------------------------------------- #
21
+
22
+ RUN apt-get update -qq && apt-get install -y --no-install-recommends \
23
+ libcurl4-openssl-dev \
24
+ libicu-dev \
25
+ libsodium-dev \
26
+ libssl-dev \
27
+ make \
28
+ zlib1g-dev \
29
+ && apt-get clean
30
+
31
+ COPY vetiver_renv.lock renv.lock
32
+ RUN Rscript -e "install.packages('renv')"
33
+ RUN Rscript -e "renv::restore()"
34
+ COPY plumber.R /opt/ml/plumber.R
35
+ EXPOSE 7860
36
+ ENTRYPOINT ["R", "-e", "pr <- plumber::plumb('/opt/ml/plumber.R'); pr$run(host = '0.0.0.0', port = 7860)"]