Skip to content

Commit 5de5891

Browse files
devhawkCopilot
andauthored
DevContainer support (#340)
Add `.devcontainer` files to enable using [VS Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) and/or [GitHub Codespaces](https://github.com/features/codespaces). --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9bbce5e commit 5de5891

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.devcontainer/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# DBOS Transact Java - Development Container
2+
3+
Simple devcontainer configuration for GitHub Codespaces and VS Code Dev Containers.
4+
5+
## What's Included
6+
7+
- **Java 21**: Pre-installed and ready to use
8+
- **Docker-in-Docker**: For running Testcontainers in tests
9+
- **VS Code Extensions**: Java Extension Pack
10+
11+
## Quick Start
12+
13+
### GitHub Codespaces
14+
1. Click "Code" → "Codespaces" → "Create codespace"
15+
2. Run `./gradlew build` to build the project
16+
3. Run `./gradlew test` to run tests
17+
18+
### VS Code Dev Containers (Local)
19+
1. Open project in VS Code with "Dev Containers" extension installed
20+
2. Select "Reopen in Container" when prompted
21+
3. Run `./gradlew build` to build the project
22+
23+
## Testing
24+
25+
Tests use **Testcontainers** to automatically spin up PostgreSQL instances - no manual setup needed!
26+
27+
```bash
28+
./gradlew test
29+
```

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Java 21 Bare Minimum",
3+
"image": "mcr.microsoft.com/devcontainers/java:21",
4+
"features": {
5+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
6+
"moby": false
7+
}
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": ["vscjava.vscode-java-pack"]
12+
}
13+
},
14+
"remoteUser": "vscode"
15+
}

0 commit comments

Comments
 (0)