r-chatbot / Dockerfile
jameshwade's picture
update container to expose secrets
14437d9
raw
history blame
490 Bytes
FROM rocker/shiny-verse:latest
WORKDIR /code
# Expose the secret OPENAI_API_KEY at buildtime and use its value as an environment variable
RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true \
echo "OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY)" > .env
# Install stable packages from CRAN
RUN install2.r --error \
shiny \
bslib \
httpuv \
purrr \
glue \
httr2
COPY . .
CMD ["R", "--quiet", "-e", "shiny::runApp(host='0.0.0.0', port=7860)"]