Skip to content

Commit 30e9146

Browse files
ilyaZarVincentGuyader
authored andcommitted
fix: set golem.app.prod to TRUE automatically in CMD
1 parent 91b8ebb commit 30e9146

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

R/add_dockerfiles_renv.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,15 @@ add_dockerfile_with_renv <- function(
318318
append = single_file
319319
)
320320

321+
if (set_golem.app.prod) {
322+
cat_info(
323+
sprintf(
324+
"Dockerfile CMD sets options(golem.app.prod = %s)",
325+
set_golem.app.prod
326+
)
327+
)
328+
}
329+
321330
if (!single_file) {
322331
out <- sprintf(
323332
"# use cd to move to the folder containing the Dockerfile
@@ -431,10 +440,11 @@ add_dockerfile_with_renv_shinyproxy <- function(
431440
single_file = single_file,
432441
set_golem.app.prod = set_golem.app.prod,
433442
dockerfile_cmd = sprintf(
434-
"R -e \"options('shiny.port'=3838,shiny.host='0.0.0.0');library(%1$s);%1$s::run_app()\"",
443+
"R -e \"options('shiny.port'=3838,shiny.host='0.0.0.0',golem.app.prod=%2$s);library(%1$s);%1$s::run_app()\"",
435444
get_golem_name(
436445
golem_wd = golem_wd
437-
)
446+
),
447+
set_golem.app.prod
438448
),
439449
...
440450
)
@@ -490,10 +500,11 @@ add_dockerfile_with_renv_heroku <- function(
490500
single_file = single_file,
491501
set_golem.app.prod = set_golem.app.prod,
492502
dockerfile_cmd = sprintf(
493-
"R -e \"options('shiny.port'=$PORT,shiny.host='0.0.0.0');library(%1$s);%1$s::run_app()\"",
503+
"R -e \"options('shiny.port'=$PORT,shiny.host='0.0.0.0',golem.app.prod=%2$s);library(%1$s);%1$s::run_app()\"",
494504
get_golem_name(
495505
golem_wd = golem_wd
496-
)
506+
),
507+
set_golem.app.prod
497508
),
498509
...
499510
)

0 commit comments

Comments
 (0)