From b4d2757897bd449ac31b7741749b9d635fe46aba Mon Sep 17 00:00:00 2001
From: Cristiano Magro <cristiano.magro@vola.it>
Date: Sat, 04 Oct 2025 20:48:16 +0200
Subject: [PATCH] vcode ambiente sviluppo in docker
---
.devcontainer/Dockerfile | 18 +++++++++
.devcontainer/docker-compose.yml | 11 +++++
.devcontainer/devcontainer.json | 19 +++++++++
pom.xml | 34 +++++++++++++++++
4 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 0000000..0a1f4e9
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,18 @@
+FROM openjdk:25-ea-18-slim
+
+# Install tools (esempio: Maven)
+RUN apt-get update && \
+ apt-get install -y maven git curl unzip && \
+ rm -rf /var/lib/apt/lists/*
+
+# Crea utente vscode (richiesto per VS Code Dev Container)
+RUN useradd -ms /bin/bash vscode && echo "vscode ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
+
+# Imposta la directory di lavoro
+WORKDIR /workspace
+
+# Imposta utente vscode
+USER vscode
+
+ENV JAVA_HOME=/usr/local/openjdk-25
+ENV PATH=$JAVA_HOME/bin:$PATH
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..20043bc
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,19 @@
+{
+ "name": "Java Dev Container",
+ "dockerComposeFile": "docker-compose.yml",
+ "service": "java-dev",
+ "workspaceFolder": "/workspace",
+ "customizations": {
+ "vscode": {
+ "settings": {
+ "terminal.integrated.defaultProfile.linux": "bash"
+ },
+ "extensions": [
+ "vscjava.vscode-java-pack", // Java Extension Pack
+ "pivotal.vscode-spring-boot", // Spring support (opzionale)
+ "test-editor.test-editor", // Supporto ai test (opzionale)
+ "redhat.java" // Supporto al linguaggio Java
+ ]
+ }
+ }
+}
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
new file mode 100644
index 0000000..7f21100
--- /dev/null
+++ b/.devcontainer/docker-compose.yml
@@ -0,0 +1,11 @@
+services:
+ java-dev:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ container_name: java-dev
+ volumes:
+ - ..:/workspace:cached
+ tty: true
+ command: sleep infinity
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..570f23c
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,34 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.example</groupId>
+ <artifactId>java-dev-container-project</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <maven.compiler.source>25</maven.compiler.source>
+ <maven.compiler.target>25</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+ <!-- Add your project dependencies here -->
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ <configuration>
+ <source>25</source>
+ <target>25</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--
Gitblit v1.8.0