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)
This commit is contained in:
Celes Renata
2026-04-30 23:18:43 +00:00
parent c42f2223d8
commit 6169efdc89
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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
@@ -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: