Spaces:
Runtime error
Runtime error
File size: 918 Bytes
4358660 3f641c2 b57a5c0 3f641c2 fc628dc 15d3c9a fc628dc 15d3c9a 3f641c2 4358660 b3c7a65 fc628dc 4358660 15d3c9a b57a5c0 3f641c2 3e6cafa b57a5c0 |
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 35 36 |
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/user/R/library
# Create a personal R library directory
RUN mkdir -p /home/user/R/library
# 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=OPENAI_API_KEY,mode=0444,required=true \
echo "OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY)" >> $HOME/.Renviron
EXPOSE 7860
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"] |