Skip to content

Commit

Permalink
Merge pull request #349 from bhadreshdesai/add-devcontainer
Browse files Browse the repository at this point in the history
Add devcontainer
  • Loading branch information
mraible authored Jun 7, 2024
2 parents 758ef35 + 5362328 commit 64ecedc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java/.devcontainer/base.Dockerfile

# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
ARG VARIANT="17-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, defaults to generator-jhipster-quarkus default node version.
ARG NODE_VERSION="20.12.2"

RUN su -p vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install $NODE_VERSION 2>&1";

41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/java
{
"name": "generator-jhipster-quarkus",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update the VARIANT arg to pick a Java version: 11, 17
// Append -bullseye or -buster to pin to an OS version.
// Use the -bullseye variants on local arm64/Apple Silicon.
"VARIANT": "17-bullseye",
"NODE_VERSION": "20.12.2"
}
},
"mounts": [
// If your system OS/Architecture doesn't matches the container one, you can uncomment the following line and create node_modules_container to keep local and containers node_module usable.
// "source=${localWorkspaceFolder}/node_modules_container,target=/workspaces/generator-jhipster-quarkus/node_modules,type=bind,consistency=cached",
// "source=${localWorkspaceFolder}/../jhipster-samples,target=/workspaces/jhipster-samples,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"java.jdt.ls.java.home": "/docker-java-home"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": ["eamodio.gitlens", "esbenp.prettier-vscode", "vitest.explorer"]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "npm ci",
// Configure tool-specific properties.
// "customizations": {},
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

0 comments on commit 64ecedc

Please sign in to comment.