Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add support for DevContainers (#2933)

Dennis Kuijsb8e3e7fc3f44
diff --git a/.devcontainer/README.md b/.devcontainer/README.md
new file mode 100644
index 000000000..ed26f67d0
--- /dev/null
+++ b/.devcontainer/README.md
@@ -0,0 +1,21 @@
+# OpenRemote DevContainer Setup (Beta)
+
+This DevContainer provides a complete development environment for OpenRemote with Java, Node.js, Docker, and all necessary tools pre-configured.
+
+Please note that this feature is still in beta and may not be supported or work correctly in all IDEs.
+Tested and working with IntelliJ.
+
+## Quick Start
+
+1. **Open in DevContainer**: IntelliJ should automatically detect the DevContainer configuration and prompt you to reopen in container.
+
+2. **Wait for Setup**: The DevContainer will automatically:
+ - Install Java, Node.js, and required tools
+ - Start Docker services (PostgreSQL, Keycloak)
+ - Build the project with `./gradlew clean installDist`
+
+3. **Launch Configurations Available**:
+ - **Manager (Debug Demo Setup, one-click)**
+ - **Manager (Debug Test Setup, one-click)**
+ - **Manager (Debug Empty Setup, one-click)**
+
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..8451a8813
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,27 @@
+{
+ "name": "OpenRemote DevContainer",
+ "image": "mcr.microsoft.com/devcontainers/base:bookworm",
+ "remoteUser": "root",
+ "features": {
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {},
+ "ghcr.io/devcontainers/features/node:1": {},
+ "ghcr.io/devcontainers/features/aws-cli:1": {},
+ "ghcr.io/devcontainers/features/github-cli:1": {},
+ "ghcr.io/devcontainers/features/git-lfs:1": {},
+ "ghcr.io/devcontainers/features/java:1": {
+ "version": "21",
+ "jdkDistro": "open",
+ "installGradle": "true",
+ "installGroovy": "true"
+ }
+ },
+ "mounts": [
+ "source=${localEnv:HOME}/.gradle,target=/root/.gradle,type=bind"
+ ],
+ "forwardPorts": [ 8080 ],
+ "postCreateCommand": "./gradlew clean installDist",
+ "postStartCommand": "docker compose -p openremote -f profile/dev-testing.yml up -d",
+ "remoteEnv": {
+ "GRADLE_USER_HOME": "/root/.gradle"
+ }
+}