modify dockerfile and add shiny server config to host rmd

This commit is contained in:
2025-11-29 23:24:43 -05:00
parent dd75820dd1
commit 5644ecbd6b
2 changed files with 30 additions and 9 deletions
+16 -9
View File
@@ -33,6 +33,7 @@ COPY renv/settings.json renv/settings.json
RUN mkdir -p renv/.cache
ENV RENV_PATHS_CACHE=renv/.cache
ENV RENV_CONFIG_CACHE_SYMLINKS=FALSE
RUN R -s -e "renv::restore()"
@@ -58,15 +59,21 @@ RUN apt-get update && apt-get install -y \
pandoc \
&& rm -rf /var/lib/apt/lists/*
COPY --from=renv-base /app/renv /app/renv
COPY --from=renv-base /app/.Rprofile /app/.Rprofile
COPY --from=renv-base /app/renv.lock /app/renv.lock
RUN mkdir -p /srv/shiny-server/app
COPY dashboard.Rmd dashboard.Rmd
COPY queries.R queries.R
COPY utils.R utils.R
COPY config.yml config.yml
COPY --from=renv-base /app/renv /srv/shiny-server/app/renv
COPY --from=renv-base /app/.Rprofile /srv/shiny-server/app/.Rprofile
COPY --from=renv-base /app/renv.lock /srv/shiny-server/app/renv.lock
EXPOSE 8080
COPY dashboard.Rmd /srv/shiny-server/app/index.Rmd
COPY queries.R /srv/shiny-server/app/
COPY utils.R /srv/shiny-server/app/
COPY config.yml /srv/shiny-server/app/
CMD ["R", "-e", "rmarkdown::run('dashboard.Rmd', shiny_args = list(host = '0.0.0.0', port = 8080))"]
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
RUN chown -R shiny:shiny /srv/shiny-server/app
EXPOSE 3838
CMD ["/usr/bin/shiny-server"]
+14
View File
@@ -0,0 +1,14 @@
# Shiny Server configuration
run_as shiny;
# Define the server
server {
listen 3838;
# Define the location for the app
location / {
site_dir /srv/shiny-server/app;
log_dir /var/log/shiny-server;
directory_index on;
}
}