Skip to content

Commit dae5c94

Browse files
authored
add .devcontainer (#551)
1 parent 89e1346 commit dae5c94

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// SS3 Developer Codespace
2+
// This codespace contains R and a port for an Rstudio server in case
3+
// that is the preferred IDE over VSCode.
4+
// R packages commonly used with SS3 are also installed (see install.R).
5+
{
6+
"name": "R (rocker/tidyverse)",
7+
"image": "ghcr.io/rocker-org/devcontainer/tidyverse:4.3",
8+
9+
"features": {
10+
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {},
11+
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
12+
"packages": "make,gcc,g++,cmake,clang-tidy,clang-format"
13+
},
14+
"ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
15+
"packages": "cli,rlang,scales,covr,devtools,ggplot2,reshape2,dplyr,tidyr,Rcpp,rlist,viridis,plyr,flextable,gridExtra,data.table,adnuts,gt,gtExtras,stringr,purrr,furrr",
16+
"installSystemRequirements": true
17+
}
18+
},
19+
"customizations": {
20+
"vscode": {
21+
"settings": {
22+
"r.rterm.linux": "/usr/local/bin/radian",
23+
"r.bracketedPaste": true,
24+
"r.plot.useHttpgd": true,
25+
"[r]": {
26+
"editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?"
27+
}
28+
},
29+
"extensions":[
30+
"GitHub.codespaces",
31+
"hbenl.vscode-test-explorer",
32+
"reditorsupport.r",
33+
"rdebugger.r-debugger",
34+
"ms-vsliveshare.vsliveshare",
35+
"mathematic.vscode-pdf"
36+
]
37+
}
38+
},
39+
"forwardPorts": [8787],
40+
"portsAttributes": {
41+
"8787": {
42+
"label": "Rstudio",
43+
"requireLocalPort": true,
44+
"onAutoForward": "ignore"
45+
}
46+
},
47+
// Use 'postCreateCommand' to run commands after the container is created.
48+
"postCreateCommand": "Rscript .devcontainer/install.R",
49+
"postAttachCommand": "sudo rstudio-server start",
50+
"remoteUser": "rstudio"
51+
52+
}

.devcontainer/install.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Install R packages
2+
# Make sure the following packages are using the most recent versions:
3+
remotes::install_github("r4ss/r4ss")
4+
remotes::install_github("ss3sim/ss3sim")
5+
remotes::install_github("nwfsc-assess/nwfscDiag")
6+
remotes::install_github("PIFSCstockassessments/ss3diags")

0 commit comments

Comments
 (0)