Commit caae4217 authored by root's avatar root

Fix: `lim` is passed as char; also change package install code in Dockerfiles

parent bfbc8da3
......@@ -8,9 +8,7 @@ RUN apt-get update &&\
apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/*
RUN cd /api &&\
sed -rn 's/library\((.*)\)/\1/p' plumber.R | sort | uniq > needed_packages &&\
curl https://gitlab.com/ConorIA/conjuntool/snippets/1788463/raw?inline=false > install_pkgs.R &&\
Rscript install_pkgs.R &&\
rm -rf /tmp/* needed_packages install_pkgs.R
Rscript -e "source('https://gitlab.com/ConorIA/conjuntool/snippets/1788463/raw')" &&\
rm -rf /tmp/*
CMD ["/api/plumber.R"]
......@@ -33,7 +33,7 @@ if (!st_meta$exists("cache_ver") || st_meta$get("cache_ver") != cache_ver) {
get_choices <- function(cmip, var, lim) {
filenames <- if (lim && cmip == "CMIP5") {
filenames <- if (lim == "TRUE" && cmip == "CMIP5") {
grep("200601-210012.nc$", dir(file.path(file_dir, cmip, var, "verified")), value = TRUE)
} else {
dir(file.path(file_dir, cmip, var, "verified"))
......
......@@ -10,8 +10,6 @@ RUN apt-get update &&\
RUN mv /srv/shiny-server/app/shiny-server.conf /etc/shiny-server/shiny-server.conf
RUN cd /srv/shiny-server/app &&\
for file in $(ls *.R); do sed -rn 's/library\((.*)\)/\1/p' $file; done | sort | uniq > needed_packages &&\
curl https://gitlab.com/ConorIA/conjuntool/snippets/1788463/raw?inline=false > install_pkgs.R &&\
Rscript install_pkgs.R &&\
Rscript -e "source(\"https://gitlab.com/ConorIA/conjuntool/snippets/1788463/raw\")" &&\
sudo -u shiny bash -c "Rscript -e \"webshot::install_phantomjs()\"" &&\
rm -rf /tmp/* needed_packages install_pkgs.R
rm -rf /tmp/*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment