Vorbereitung Release 0.2.0 #83
@@ -121,6 +121,11 @@ services:
|
||||
- kontor-javalin:0.2.0-SNAPSHOT
|
||||
image: kontor-javalin:0.2.0-SNAPSHOT
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://kontor-javalin:8400/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- database
|
||||
- integration
|
||||
|
||||
@@ -9,7 +9,9 @@ COPY ./gradle/libs.versions.toml ./gradle/
|
||||
RUN gradle build --no-daemon
|
||||
|
||||
# ----------------------------------------------------------------------- #
|
||||
FROM alpine/java:21-jdk AS run
|
||||
FROM alpine/java:21-jre AS run
|
||||
|
||||
RUN apk --no-cache add curl
|
||||
|
||||
RUN adduser --system appuser
|
||||
USER appuser
|
||||
|
||||
@@ -2,6 +2,9 @@ package de.thpeetz.kontor.api;
|
||||
|
||||
import de.thpeetz.kontor.services.inmemory.InMemoryPersonReader;
|
||||
import io.javalin.Javalin;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -19,6 +22,11 @@ public class Main {
|
||||
|
||||
var app = Javalin.create().start(port);
|
||||
app.get("/ping", ctx -> ctx.result("pong"));
|
||||
app.get("/health", ctx -> {
|
||||
HashMap<String, String> status = new HashMap<>();
|
||||
status.put("status", "ok");
|
||||
ctx.json(status);
|
||||
});
|
||||
app.get("/persons", ctx -> {
|
||||
logger.info("persons called");
|
||||
ctx.json(result);
|
||||
|
||||
Reference in New Issue
Block a user