Skip to content

Commit f4c3c61

Browse files
Update R/add_dockerfiles_renv.R
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ae4e2e2 commit f4c3c61

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

R/add_dockerfiles_renv.R

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -270,56 +270,57 @@ add_dockerfile_with_renv <- function(
270270
...,
271271
source_folder
272272
) {
273-
signal_arg_is_deprecated(
274-
source_folder,
275-
fun = as.character(sys.call()[[1]]),
276-
"source_folder"
277-
)
278-
279-
base_dock <- add_dockerfile_with_renv_(
280-
golem_wd = golem_wd,
281-
lockfile = lockfile,
282-
output_dir = output_dir,
283-
distro = distro,
284-
FROM = from,
285-
AS = as,
286-
sysreqs = sysreqs,
287-
repos = repos,
288-
expand = expand,
289-
extra_sysreqs = extra_sysreqs,
290-
update_tar_gz = update_tar_gz,
291-
document = document,
292-
single_file = single_file,
293-
...
294-
)
295-
if (!is.null(port)) {
296-
base_dock$EXPOSE(port)
297-
}
298-
if (!is.null(user)) {
299-
base_dock$USER(user)
300-
}
301-
if (is.null(dockerfile_cmd)) {
302-
dockerfile_cmd <- sprintf(
303-
"R -e \"options('shiny.port'=%s,shiny.host='%s',golem.app.prod=%s);library(%4$s);%4$s::run_app()\"",
304-
port,
305-
host,
306-
set_golem.app.prod,
307-
get_golem_name(
308-
golem_wd = golem_wd
309-
)
310-
)
311-
}
312-
base_dock$CMD(
313-
dockerfile_cmd
314-
)
315-
base_dock
316-
base_dock$write(as = file.path(output_dir, "Dockerfile"),
317-
append = single_file)
273+
signal_arg_is_deprecated(
274+
source_folder,
275+
fun = as.character(sys.call()[[1]]),
276+
"source_folder"
277+
)
318278

279+
base_dock <- add_dockerfile_with_renv_(
280+
golem_wd = golem_wd,
281+
lockfile = lockfile,
282+
output_dir = output_dir,
283+
distro = distro,
284+
FROM = from,
285+
AS = as,
286+
sysreqs = sysreqs,
287+
repos = repos,
288+
expand = expand,
289+
extra_sysreqs = extra_sysreqs,
290+
update_tar_gz = update_tar_gz,
291+
document = document,
292+
single_file = single_file,
293+
...
294+
)
295+
if (!is.null(port)) {
296+
base_dock$EXPOSE(port)
297+
}
298+
if (!is.null(user)) {
299+
base_dock$USER(user)
300+
}
301+
if (is.null(dockerfile_cmd)) {
302+
dockerfile_cmd <- sprintf(
303+
"R -e \"options('shiny.port'=%s,shiny.host='%s',golem.app.prod=%s);library(%4$s);%4$s::run_app()\"",
304+
port,
305+
host,
306+
set_golem.app.prod,
307+
get_golem_name(
308+
golem_wd = golem_wd
309+
)
310+
)
311+
}
312+
base_dock$CMD(
313+
dockerfile_cmd
314+
)
315+
base_dock
316+
base_dock$write(
317+
as = file.path(output_dir, "Dockerfile"),
318+
append = single_file
319+
)
319320

320-
if (!single_file){
321-
out <- sprintf(
322-
"# use cd to move to the folder containing the Dockerfile
321+
if (!single_file) {
322+
out <- sprintf(
323+
"# use cd to move to the folder containing the Dockerfile
323324
docker build -f Dockerfile_base --progress=plain -t %s .
324325
docker build -f Dockerfile --progress=plain -t %s .
325326
docker run -p %s:%s %s

0 commit comments

Comments
 (0)