From 5c77d613b798e2529fd05a503a1ca0fce4602804 Mon Sep 17 00:00:00 2001 From: Tudor Date: Tue, 24 Mar 2026 14:32:51 +0000 Subject: [PATCH] fix(kestra-init): use alpine+curl instead of kestra image to avoid 413 kestra/kestra:latest is ~500MB; the registry rejects the push. The init container only needs to POST flow YAMLs to the Kestra REST API (/api/v1/flows/import), which curl handles fine from a tiny alpine base. Co-Authored-By: Claude Sonnet 4.6 --- docker-compose.yml | 18 +----------------- integrator/Dockerfile.init | 7 +++++-- integrator/docker/kestra-init.sh | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 19 deletions(-) create mode 100644 integrator/docker/kestra-init.sh diff --git a/docker-compose.yml b/docker-compose.yml index d4e3917..ee5ad58 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -114,24 +114,8 @@ services: kestra-init: image: privaterepo.sitaru.org/tudor/school_compare-kestra-init:latest container_name: schoolcompare_kestra_init - command: flow namespace update schoolcompare.data /flows --no-delete environment: - KESTRA_CONFIGURATION: | - datasources: - postgres: - url: jdbc:postgresql://db:5432/kestra - driverClassName: org.postgresql.Driver - username: schoolcompare - password: schoolcompare - kestra: - repository: - type: postgres - queue: - type: postgres - storage: - type: local - local: - base-path: /tmp/kestra-init-storage + KESTRA_URL: http://kestra:8080 depends_on: kestra: condition: service_healthy diff --git a/integrator/Dockerfile.init b/integrator/Dockerfile.init index 9f24969..ad248bf 100644 --- a/integrator/Dockerfile.init +++ b/integrator/Dockerfile.init @@ -1,3 +1,6 @@ -FROM kestra/kestra:latest +FROM alpine:3.19 +RUN apk add --no-cache curl COPY flows/ /flows/ -CMD ["flow", "namespace", "update", "schoolcompare.data", "/flows", "--no-delete"] +COPY docker/kestra-init.sh /kestra-init.sh +RUN chmod +x /kestra-init.sh +CMD ["/kestra-init.sh"] diff --git a/integrator/docker/kestra-init.sh b/integrator/docker/kestra-init.sh new file mode 100644 index 0000000..624a2ec --- /dev/null +++ b/integrator/docker/kestra-init.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +KESTRA_URL="${KESTRA_URL:-http://kestra:8080}" + +echo "Importing flows into Kestra at ${KESTRA_URL}..." + +for f in /flows/*.yml; do + echo " -> $(basename "$f")" + curl -sf -X POST "${KESTRA_URL}/api/v1/flows/import" \ + -H "Content-Type: multipart/form-data" \ + -F "fileUpload=@${f}" \ + || { echo "Failed to import $(basename "$f")"; exit 1; } + echo "" +done + +echo "All flows imported."