I am looking for best practises on package dependency management as I am going to deploy a shiny app. My goal is to have an infrastructure which allows me to easily develop new features locally, have these automatically tested (e.g. Gitlab CI) and deployed to a server. Docker seems to be a good choice for this task. My question is mainly how I should take care of the packages my app depends on.
checkpoint: Only works with CRAN packages and not local packages and there seems to be a bug regarding setting the repos option: Checkpoint Issue
Microsoft R Open: Similar to checkpoint and a bit too fixed on old package versions without the chance to use newer package releases on CRAN or Github.
packrat: I have tried this several times now, it installs packages for a few hours! and then fails if my code includes local packages. And I did not really understand what benefits it could offer me to just change .libPaths via a project-specific .Rprofile to a library folder in the project, so all packages are just installed there (this is the approach I chose so far). Then I would copy this folder into my docker image and have all dependencies in place?
Should I commit the library folder with all the package dependencies to my Git repo? Then I could have different versions of packages for different feature branches. Are there any drawbacks?
Would really appreciate some feedback, because the right choice for dealing with package dependencies will probably save me lots of time in the future during development and deployment.