Add devcontainer and gitpod

Also works in codespaces.
This commit is contained in:
Dave Syer 2022-06-08 13:04:08 +00:00
parent 0c1fa8e8e2
commit abee85939f
5 changed files with 42 additions and 0 deletions

5
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,5 @@
ARG VARIANT=11-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

View file

@ -0,0 +1,25 @@
{
"name": "Petclinic",
"dockerFile": "Dockerfile",
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"redhat.vscode-xml"
]
}
},
"runArgs": [
"--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined",
"--mount", "type=bind,source=${env:HOME}/.m2,target=/home/vscode/.m2",
"--mount", "type=bind,source=${env:HOME}/.gradle,target=/home/vscode/.gradle"
],
"initializeCommand": "mkdir -p ${env:HOME}/.m2 ${env:HOME}/.gradle",
"onCreateCommand": "sudo chown vscode:vscode /home/vscode/.m2 /home/vscode/.gradle",
"remoteUser": "vscode",
"features": {
"docker-in-docker": "latest"
}
}