r-chatbot / Dockerfile
jameshwade's picture
create user lib
fc628dc
raw
history blame
823 Bytes
FROM rocker/shiny-verse:latest
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
R_LIBS_USER=$HOME/R/library
# Create a personal R library directory
RUN mkdir -p $R_LIBS_USER
# Set the working directory to the user's home directory
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
# Install stable packages from CRAN
RUN install2.r --error \
bslib \
httpuv \
purrr \
glue \
httr2
RUN --mount=type=secret,id=SECRET_EXAMPLE,mode=0444,required=true
EXPOSE 7860
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]