fix: run bootstrap via module to avoid stdlib http shadowing

Switch container startup from file execution to module execution so
urllib can import stdlib http.client reliably.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
mmc
2026-04-21 13:57:44 +08:00
parent 83d69097c9
commit 4748432501

View File

@@ -28,4 +28,4 @@ port=os.environ.get('PORT','8317'); \
r=urllib.request.urlopen(f'http://127.0.0.1:{port}/healthz', timeout=3); \ r=urllib.request.urlopen(f'http://127.0.0.1:{port}/healthz', timeout=3); \
sys.exit(0 if json.load(r).get('ok') else 1)" || exit 1 sys.exit(0 if json.load(r).get('ok') else 1)" || exit 1
CMD ["sh", "-c", "python /app/app/bootstrap_lingma.py && uvicorn app.main:app --host ${HOST:-0.0.0.0} --port ${PORT:-8317}"] CMD ["sh", "-c", "python -m app.bootstrap_lingma && uvicorn app.main:app --host ${HOST:-0.0.0.0} --port ${PORT:-8317}"]