File size: 1,130 Bytes
63f44c7
 
 
 
b1fbb1c
 
63f44c7
 
 
 
64cf28b
63f44c7
 
 
 
 
 
 
 
64cf28b
63f44c7
 
 
 
 
50a814d
63f44c7
59ed2ed
63f44c7
59ed2ed
63f44c7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Generated by the vetiver package; edit with care

FROM rocker/r-ver:4.0.5
# Create a non-root user to run the application
RUN useradd -m -u 1000 appuser
USER appuser

ENV RENV_CONFIG_REPOS_OVERRIDE https://packagemanager.rstudio.com/cran/latest
ENV HOME=/home/appuser
WORKDIR $HOME
USER root
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
  libcurl4-openssl-dev \
  libicu-dev \
  libsodium-dev \
  libssl-dev \
  make \
  zlib1g-dev \
  && apt-get clean
USER appuser
COPY vetiver_renv.lock renv.lock
# Create the .cache directory and give appuser permission to write to it
RUN mkdir -p /home/appuser/.cache && chown -R appuser:appuser /home/appuser/.cache
# Create the .cache/pins/url directory and give appuser permission to write to it
RUN mkdir -p /home/appuser/.cache/pins/url && chown -R appuser:appuser /home/appuser/.cache/pins/url
USER root
RUN Rscript -e "install.packages('renv')"
#USER appuser
RUN Rscript -e "renv::restore()"
USER appuser
COPY plumber.R /opt/ml/plumber.R
EXPOSE 7860
ENTRYPOINT ["R", "-e", "pr <- plumber::plumb('/opt/ml/plumber.R'); pr$run(host = '0.0.0.0', port = 7860)"]