Skip to content

Instantly share code, notes, and snippets.

@ngnam
Created October 15, 2025 03:15
Show Gist options
  • Select an option

  • Save ngnam/37db4d4f50017dc258f5391087c4a8ab to your computer and use it in GitHub Desktop.

Select an option

Save ngnam/37db4d4f50017dc258f5391087c4a8ab to your computer and use it in GitHub Desktop.
.devcontainer/devcontainer.json
{
"name": "Digital Bank Backend (Spring Boot 3, Java 17, SQLite)",
// Dùng image chính thức của devcontainers có sẵn Java 17 + Gradle/Maven
"image": "mcr.microsoft.com/devcontainers/java:17",
// Thư mục làm việc trong container
"workspaceFolder": "/workspace",
// Mount source code vào container
"mounts": [
"source=.,target=/workspace,type=bind,consistency=cached",
"source=gradle-cache,target=/home/vscode/.gradle,type=volume"
],
// Forward port 8080 để test Spring Boot app
"forwardPorts": [8080],
// Cài thêm extensions hữu ích cho Java + Spring Boot
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vscjava.vscode-spring-boot-dashboard",
"vscjava.vscode-spring-initializr",
"pivotal.vscode-spring-boot",
"redhat.vscode-yaml",
"esbenp.prettier-vscode"
]
}
},
// Chạy sau khi container tạo xong
"postCreateCommand": "chmod +x ./gradlew || true && ./gradlew build -x test",
// User mặc định
"remoteUser": "vscode"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment