add kontor-javalin to podman pod
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# ----------------------------------------------------------------------- #
|
# ----------------------------------------------------------------------- #
|
||||||
FROM gradle:9.2.1-jdk21 AS builder
|
FROM docker.io/library/gradle:9.2.1-jdk21 AS builder
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
COPY ./src/main/ ./src/main/
|
COPY ./src/main/ ./src/main/
|
||||||
COPY ./build.gradle ./
|
COPY ./build.gradle ./
|
||||||
@@ -13,13 +13,9 @@ FROM alpine/java:21-jre AS run
|
|||||||
|
|
||||||
RUN apk --no-cache add curl
|
RUN apk --no-cache add curl
|
||||||
|
|
||||||
RUN adduser --system appuser
|
COPY --from=builder /build/libs/kontor-javalin-0.2.0-SNAPSHOT.jar app.jar
|
||||||
USER appuser
|
|
||||||
|
|
||||||
COPY --from=builder --chown=appuser:appuser /build/libs/kontor-javalin-0.2.0-SNAPSHOT.jar app.jar
|
EXPOSE 8600
|
||||||
|
|
||||||
EXPOSE 8400
|
|
||||||
USER appuser
|
|
||||||
|
|
||||||
CMD ["java", "-jar", "app.jar"]
|
CMD ["java", "-jar", "app.jar"]
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ import io.javalin.config.Key;
|
|||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
private static Logger logger = LoggerFactory.getLogger(Main.class);
|
private static Logger logger = LoggerFactory.getLogger(Main.class);
|
||||||
private static short port = 8400;
|
private static short port = 8600;
|
||||||
// private static Key<EntityManagerFactory> emf = new
|
// private static Key<EntityManagerFactory> emf = new
|
||||||
// Key<EntityManagerFactory>("entityManagerFactory");
|
// Key<EntityManagerFactory>("entityManagerFactory");
|
||||||
private static Key<SessionFactory> sf = new Key<>("SessionFactory");
|
private static Key<SessionFactory> sf = new Key<>("SessionFactory");
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ else
|
|||||||
-p 8300:8300 \
|
-p 8300:8300 \
|
||||||
-p 8400:8400 \
|
-p 8400:8400 \
|
||||||
-p 8500:8500 \
|
-p 8500:8500 \
|
||||||
|
-p 8600:8600 \
|
||||||
-p 8900:8080 \
|
-p 8900:8080 \
|
||||||
-p 61616:61616 \
|
-p 61616:61616 \
|
||||||
-p 8161:8161 \
|
-p 8161:8161 \
|
||||||
@@ -101,6 +102,7 @@ else
|
|||||||
--pod kontor \
|
--pod kontor \
|
||||||
--name kontor-spring \
|
--name kontor-spring \
|
||||||
--label "io.containers.autoupdate=local" \
|
--label "io.containers.autoupdate=local" \
|
||||||
|
--label "PODMAN_SYSTEMD_UNIT=container-kontor-spring.service" \
|
||||||
localhost/kontor-spring:0.3.0
|
localhost/kontor-spring:0.3.0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -204,3 +206,28 @@ else
|
|||||||
localhost/kontor-fiber:0.3.0
|
localhost/kontor-fiber:0.3.0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "==> Setting up container kontor-javalin"
|
||||||
|
if podman image exists localhost/kontor-javalin:0.3.0; then
|
||||||
|
echo " => Image localhost/kontor-javalin:0.3.0 available"
|
||||||
|
else
|
||||||
|
echo " => Baue Image localhost/kontor-javalin:0.3.0"
|
||||||
|
buildah build -t kontor-javalin:0.3.0 kontor-javalin
|
||||||
|
fi
|
||||||
|
|
||||||
|
if podman container exists kontor-javalin; then
|
||||||
|
if podman ps -q --filter "name=kontor-javalin"; then
|
||||||
|
echo " => kontor-javalin is running"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
podman run -d \
|
||||||
|
--replace \
|
||||||
|
--pod kontor \
|
||||||
|
--name kontor-javalin \
|
||||||
|
--label "io.containers.autoupdate=local" \
|
||||||
|
--label "PODMAN_SYSTEMD_UNIT=container-kontor-javalin.service" \
|
||||||
|
--health-cmd='curl -f http://kontor-echo:8600/health || exit 1' \
|
||||||
|
--health-interval=1s \
|
||||||
|
--health-timeout=5s \
|
||||||
|
--health-retries=10 \
|
||||||
|
localhost/kontor-javalin:0.3.0
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user