fix(kestra-init): use alpine+curl instead of kestra image to avoid 413
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 34s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m4s
Build and Push Docker Images / Build Integrator (push) Successful in 56s
Build and Push Docker Images / Build Kestra Init (push) Successful in 32s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

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 <noreply@anthropic.com>
This commit is contained in:
2026-03-24 14:32:51 +00:00
parent 580311a5b8
commit 5c77d613b7
3 changed files with 23 additions and 19 deletions

View File

@@ -114,24 +114,8 @@ services:
kestra-init: kestra-init:
image: privaterepo.sitaru.org/tudor/school_compare-kestra-init:latest image: privaterepo.sitaru.org/tudor/school_compare-kestra-init:latest
container_name: schoolcompare_kestra_init container_name: schoolcompare_kestra_init
command: flow namespace update schoolcompare.data /flows --no-delete
environment: environment:
KESTRA_CONFIGURATION: | KESTRA_URL: http://kestra:8080
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
depends_on: depends_on:
kestra: kestra:
condition: service_healthy condition: service_healthy

View File

@@ -1,3 +1,6 @@
FROM kestra/kestra:latest FROM alpine:3.19
RUN apk add --no-cache curl
COPY flows/ /flows/ 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"]

View File

@@ -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."