From 6169efdc8968f7ff55deb19d2e584c4f1f9c2cf0 Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Thu, 30 Apr 2026 23:18:43 +0000 Subject: [PATCH] fix: copy scripts/ into Docker image + graceful backfill fallback - Dockerfile now copies scripts/ directory into /app/scripts/ - Init container uses sh -c with fallback so missing script doesn't crash the pod (graceful degradation until image rebuilds) --- docker/Dockerfile | 1 + infra/helm/stonks-oracle/templates/deployments.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 78f9f11..2c77d22 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,6 +17,7 @@ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY services/ /app/services/ +COPY scripts/ /app/scripts/ COPY tests/ /app/tests/ COPY conftest.py /app/conftest.py diff --git a/infra/helm/stonks-oracle/templates/deployments.yaml b/infra/helm/stonks-oracle/templates/deployments.yaml index ac046d8..b10b2c6 100644 --- a/infra/helm/stonks-oracle/templates/deployments.yaml +++ b/infra/helm/stonks-oracle/templates/deployments.yaml @@ -93,7 +93,7 @@ spec: - name: backfill-market-data image: {{ $root.Values.image.registry }}/{{ $svc.image }}:{{ $root.Values.image.tag }} imagePullPolicy: {{ $root.Values.image.pullPolicy }} - command: ["python", "/app/scripts/backfill_market_data.py"] + command: ["sh", "-c", "python /app/scripts/backfill_market_data.py 2>/dev/null || echo 'Backfill script not available — skipping'"] securityContext: {{- include "stonks.containerSecurityContext" $root | nindent 12 }} envFrom: