ultima version del docker y launch y tasks

This commit is contained in:
Jaime Jiménez
2025-06-13 13:38:13 +02:00
parent 06889201e5
commit 9236d8ccd1
5 changed files with 31 additions and 25 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target/

27
.vscode/launch.json vendored
View File

@ -1,17 +1,14 @@
{ {
// Use IntelliSense to learn about possible attributes. "version": "0.2.0",
// Hover to view descriptions of existing attributes. "configurations": [
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 {
"version": "0.2.0", "type": "java",
"configurations": [ "name": "Debug Spring Boot in Docker",
{ "request": "attach",
"type": "java", "hostName": "localhost",
"name": "Depurar Spring Boot en Docker", "port": 5005,
"request": "attach", "preLaunchTask": "Start Spring Boot in Docker (Debug)",
"hostName": "localhost", "postDebugTask": "Stop Spring Boot in Docker"
"port": 5005, }
"preLaunchTask": "Run Spring Boot in Docker with Debug", ]
"postDebugTask": "Stop Spring Boot in Docker",
}
]
} }

23
.vscode/tasks.json vendored
View File

@ -2,27 +2,30 @@
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": [
{ {
"label": "Run Spring Boot in Docker with Debug", "label": "Start Spring Boot in Docker (Debug)",
"type": "process", "type": "process",
"command": "docker", "command": "docker",
"args": [ "args": [
"exec", "exec",
"-it", "-i",
"springboot-dev", "springboot-dev",
"./mvnw", "sh",
"spring-boot:run", "-c",
"-Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" "./mvnw spring-boot:run -o -Dspring-boot.run.fork=false -Dmaven.resources.skip=true -Dmaven.test.skip=true -Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
], ],
"problemMatcher": [], "isBackground": true,
"group": { "problemMatcher": {
"kind": "build", "background": {
"isDefault": true "activeOnStart": true,
"beginsPattern": ".*",
"endsPattern": "Listening for transport dt_socket at address: 5005"
}
} }
}, },
{ {
"label": "Stop Spring Boot in Docker", "label": "Stop Spring Boot in Docker",
"type": "shell", "type": "shell",
"command": "docker exec springboot-dev pkill -f spring-boot:run", "command": "docker exec springboot-dev pkill -f jdwp=transport",
"problemMatcher": [] "problemMatcher": []
} }
] ]

View File

@ -23,6 +23,7 @@ services:
volumes: volumes:
- ./:/app - ./:/app
- ./m2:/root/.m2 - ./m2:/root/.m2
- ./target:/app/target
ports: ports:
- "8080:8080" - "8080:8080"
- "5005:5005" - "5005:5005"

View File

@ -68,8 +68,12 @@
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<addResources>false</addResources>
</configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>