FROM rocker/shiny-verse:latest WORKDIR /code # Install stable packages from CRAN RUN install2.r --error \ shiny \ bslib \ httpuv \ purrr \ glue \ httr2 COPY . . # Create a script that reads the secret and exports it as an environment variable RUN echo '#!/bin/sh' >> start.sh && \ echo 'export OPENAI_API_KEY=$(cat /run/secrets/openai_api_key)' >> start.sh && \ echo 'R --quiet -e "shiny::runApp(host='\''0.0.0.0'\'', port=7860)"' >> start.sh && \ chmod +x start.sh CMD ["./start.sh"]