Dockerisation.

This commit is contained in:
Florian THIERRY
2025-05-11 12:39:40 +02:00
parent f98e1227e8
commit 458e72d6aa
4 changed files with 54 additions and 0 deletions

15
Dockerfile-backend Normal file
View File

@@ -0,0 +1,15 @@
FROM gradle:8.12.1-jdk21 AS builder
COPY ./gradlew /app/
COPY ./build.gradle.kts /app/
COPY ./settings.gradle.kts /app/
COPY ./demo-application /app/demo-application
COPY ./demo-domain /app/demo-domain
COPY ./demo-exposition /app/demo-exposition
COPY ./demo-infrastructure /app/demo-infrastructure
COPY ./demo-launcher /app/demo-launcher
WORKDIR /app
RUN gradle build jar
FROM eclipse-temurin:21-jre-alpine AS final
COPY --from=builder /app/demo-launcher/build/libs/demo-launcher.jar /app/demo-launcher.jar
CMD ["java", "-jar", "/app/demo-launcher.jar"]

View File

@@ -0,0 +1,11 @@
meta {
name: Debug
type: http
seq: 3
}
get {
url: {{url}}/api/debug/info
body: none
auth: none
}

View File

@@ -0,0 +1,16 @@
package com.example.demo.exposition.debug
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
@RestController
@RequestMapping("/api/debug")
class DebugController {
@GetMapping("/info")
fun debug(): String = """
{
"message": "Hello world!"
}
""".trimIndent()
}

12
docker-compose.yml Normal file
View File

@@ -0,0 +1,12 @@
services:
backend:
image: gitea-workshop-app:latest
container_name: gitea-workshop-app-backend
ports:
- "50000:8080"
restart: always
networks:
- "gitea-workshop"
networks:
gitea-workshop: