Add kontor-echo and kontor-fiber to kontor-pod
resolve #35 (cherry picked from commit 05e26e512da9c237adbb58510df2b490837cd836)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# ---------- Stage 1: Build ----------
|
||||
FROM golang:1.25-alpine AS builder
|
||||
FROM docker.io/library/golang:1.25-alpine AS builder
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
# Ensure a portable, static-ish binary
|
||||
@@ -18,11 +18,7 @@ FROM alpine:latest
|
||||
WORKDIR /app
|
||||
# Install runtime dependencies you actually need
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
# Create non-root user for security
|
||||
RUN addgroup -S kontor && adduser -S -G kontor -H -s /sbin/nologin kontor
|
||||
# Copy the binary and set ownership
|
||||
COPY --from=builder --chown=kontor:kontor /app/kontor /app/kontor
|
||||
# Run as non-root user
|
||||
USER kontor
|
||||
COPY --from=builder /app/kontor /app/kontor
|
||||
# Set the entrypoint command
|
||||
ENTRYPOINT ["/app/kontor"]
|
||||
@@ -49,6 +49,6 @@ func main() {
|
||||
handler.SetupComicRoutes(group)
|
||||
handler.SetupMediaRoutes(group)
|
||||
|
||||
e.Logger.Fatal(e.Start(":8700"))
|
||||
e.Logger.Fatal(e.Start(":8400"))
|
||||
log.Println("Kontor finished")
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# ---------- Stage 1: Build ----------
|
||||
FROM golang:1.25-alpine AS builder
|
||||
FROM docker.io/library/golang:1.25-alpine AS builder
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
# Ensure a portable, static-ish binary
|
||||
@@ -18,11 +18,7 @@ FROM alpine:latest
|
||||
WORKDIR /app
|
||||
# Install runtime dependencies you actually need
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
# Create non-root user for security
|
||||
RUN addgroup -S kontor && adduser -S -G kontor -H -s /sbin/nologin kontor
|
||||
# Copy the binary and set ownership
|
||||
COPY --from=builder --chown=kontor:kontor /app/kontor /app/kontor
|
||||
# Run as non-root user
|
||||
USER kontor
|
||||
COPY --from=builder /app/kontor /app/kontor
|
||||
# Set the entrypoint command
|
||||
ENTRYPOINT ["/app/kontor"]
|
||||
@@ -35,7 +35,7 @@ func main() {
|
||||
handler.SetupComicRoutes(api)
|
||||
handler.SetupMediaRoutes(api)
|
||||
// Listen on port 8900
|
||||
app.Listen(":8600")
|
||||
app.Listen(":8500")
|
||||
|
||||
log.Println("Kontor finished")
|
||||
}
|
||||
|
||||
+54
-1
@@ -23,6 +23,8 @@ else
|
||||
-p 8100:8100 \
|
||||
-p 8200:8200 \
|
||||
-p 8300:8300 \
|
||||
-p 8400:8400 \
|
||||
-p 8500:8500 \
|
||||
-p 8900:8080 \
|
||||
-p 61616:61616 \
|
||||
-p 8161:8161 \
|
||||
@@ -145,9 +147,60 @@ else
|
||||
--name kontor-quarkus \
|
||||
--label "io.containers.autoupdate=local" \
|
||||
--label "PODMAN_SYSTEMD_UNIT=container-kontor-quarkus.service" \
|
||||
--health-cmd='curl -f http://kontor-api:8300/q/health || exit 1' \
|
||||
--health-cmd='curl -f http://kontor-quarkus:8300/q/health || exit 1' \
|
||||
--health-interval=1s \
|
||||
--health-timeout=5s \
|
||||
--health-retries=10 \
|
||||
localhost/kontor-quarkus:0.3.0
|
||||
fi
|
||||
|
||||
echo "==> Setting up container kontor-echo"
|
||||
if podman image exists localhost/kontor-echo:0.3.0; then
|
||||
echo " => Image localhost/kontor-echo:0.3.0 available"
|
||||
else
|
||||
echo " => Baue Image localhost/kontor-echo:0.3.0"
|
||||
buildah build -t kontor-echo:0.3.0 kontor-echo
|
||||
fi
|
||||
if podman container exists kontor-echo; then
|
||||
if podman ps -q --filter "name=kontor-echo"; then
|
||||
echo " => kontor-echo is running"
|
||||
fi
|
||||
else
|
||||
podman run -d \
|
||||
--replace \
|
||||
--pod kontor \
|
||||
--name kontor-echo \
|
||||
--label "io.containers.autoupdate=local" \
|
||||
--label "PODMAN_SYSTEMD_UNIT=container-kontor-echo.service" \
|
||||
--health-cmd='curl -f http://kontor-echo:8400/health || exit 1' \
|
||||
--health-interval=1s \
|
||||
--health-timeout=5s \
|
||||
--health-retries=10 \
|
||||
localhost/kontor-echo:0.3.0
|
||||
fi
|
||||
|
||||
echo "==> Setting up container kontor-fiber"
|
||||
if podman image exists localhost/kontor-fiber:0.3.0; then
|
||||
echo " => Image localhost/kontor-fiber:0.3.0 available"
|
||||
else
|
||||
echo " => Baue Image localhost/kontor-fiber:0.3.0"
|
||||
buildah build -t kontor-fiber:0.3.0 kontor-fiber
|
||||
fi
|
||||
if podman container exists kontor-fiber; then
|
||||
if podman ps -q --filter "name=kontor-fiber"; then
|
||||
echo " => kontor-fiber is running"
|
||||
fi
|
||||
else
|
||||
podman run -d \
|
||||
--replace \
|
||||
--pod kontor \
|
||||
--name kontor-fiber \
|
||||
--label "io.containers.autoupdate=local" \
|
||||
--label "PODMAN_SYSTEMD_UNIT=container-kontor-fiber.service" \
|
||||
--health-cmd='curl -f http://kontor-echo:8500/health || exit 1' \
|
||||
--health-interval=1s \
|
||||
--health-timeout=5s \
|
||||
--health-retries=10 \
|
||||
localhost/kontor-fiber:0.3.0
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user