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"
}
}

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
target/* target/*
bin/*
build/* build/*
.gradle/* .gradle/*
.settings/* .settings/*

9
.gitpod.yml Normal file
View file

@ -0,0 +1,9 @@
image:
file: ./.devcontainer/Dockerfile
tasks:
- before: sudo usermod -a -G sdkman gitpod && sudo usermod -a -G nvm gitpod && sudo chown -R gitpod /usr/local/sdkman /usr/local/share/nvm
- init: ./mvnw install
vscode:
extensions:
- vscjava.vscode-java-pack
- redhat.vscode-xml

View file

@ -1,5 +1,7 @@
# Spring PetClinic Sample Application [![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml) # Spring PetClinic Sample Application [![Build Status](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml/badge.svg)](https://github.com/spring-projects/spring-petclinic/actions/workflows/maven-build.yml)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/spring-projects/spring-petclinic)
## Understanding the Spring Petclinic application with a few diagrams ## Understanding the Spring Petclinic application with a few diagrams
<a href="https://speakerdeck.com/michaelisvy/spring-petclinic-sample-application">See the presentation here</a> <a href="https://speakerdeck.com/michaelisvy/spring-petclinic-sample-application">See the presentation here</a>