r-chatbot / Dockerfile
jameshwade's picture
add ENV to dockerfile
aa00b0e
raw
history blame
579 Bytes
FROM rocker/shiny-verse:latest
# Create a non-root user to run the application
RUN adduser --disabled-password --gecos "" appuser
WORKDIR /code
# Install stable packages from CRAN
RUN install2.r --error \
shiny \
bslib \
httpuv \
purrr \
glue \
httr2
# Set the environment variable for the secret
ENV OPENAI_API_KEY=${OPENAI_API_KEY}
COPY . .
# Change the ownership of the /code directory to appuser
RUN chown -R appuser:appuser /code
# Switch to the appuser user
USER appuser
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]