You can use {devindocker} for any directory, project or even package. In the end, these are all folders on your computer.
tempdir <- tempdir()
my_project <- normalizePath(file.path(tempdir, "myproject"), mustWork = FALSE)
usethis::create_package(my_project, open = FALSE)
## ✔ Creating '/tmp/RtmpWasbWI/myproject/'.
## ✔ Setting active project to "/tmp/RtmpWasbWI/myproject".
## ✔ Creating 'R/'.
## ✔ Writing 'DESCRIPTION'.
## Package: myproject
## Title: What the Package Does (One Line, Title Case)
## Version: 0.0.0.9000
## Authors@R (parsed):
## * First Last <[email protected]> [aut, cre] (YOUR-ORCID-ID)
## Description: What the package does (one paragraph).
## License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
## license
## Encoding: UTF-8
## Roxygen: list(markdown = TRUE)
## RoxygenNote: 7.0.0
## ✔ Writing 'NAMESPACE'.
## ✔ Setting active project to "<no active project>".
# path <- "" # default
path <- my_project
# Which container with RStudio server? ----
container <- "rocker/geospatial:4.0.1"
# Which port ? ----
# _Useful if multiple Rstudio Server to launch
port <- 8788
# Start Docker project
launch_proj_docker(path = path,
container = container,
port = port)
# Stop Docker properly
stop_proj_docker(path = path, sleep = 5)