fix(docker): make container startup robust under wrapped execution#197
fix(docker): make container startup robust under wrapped execution#197mattradford wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe Dockerfile's final-stage container initialization is refactored to rely on PATH environment variable configuration instead of shell-based virtual environment activation. HEALTHCHECK and ENTRYPOINT commands are converted from shell-based to exec-form commands. A trailing whitespace in a RUN command is removed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
GitKraken automatically performed 2 actions
Create your own automations at gitkraken.dev/automations |
✅ Actions performedReview triggered.
|
Fix container startup fragility under wrapped runtime execution
Summary
Fix container startup fragility by removing runtime Python virtual environment activation and switching to an exec-form Python
ENTRYPOINTandHEALTHCHECK. Runtime Python resolution is now handled deterministically viaPATH, making startup reliable under CI/CD runners, container wrappers, and orchestration layers.This:
Why
The previous container startup relied on shell-based runtime logic:
/bin/bash -c. /venv/bin/activateThis pattern is fragile because containers are not guaranteed to be started directly by Docker in all environments. CI/CD systems, process supervisors, and orchestration layers may wrap or re-exec the container under
/bin/sh, change PID 1 behavior, or alter signal handling.Under these conditions, shell-dependent ENTRYPOINT logic can fail even though the image builds successfully. This PR removes that failure mode by:
PATHScope
Testing
What was tested
Testing focused on container runtime behavior rather than application logic:
/venv/bin/pythonThe image was exercised under both direct Docker execution and wrapped execution (representative of CI/CD and supervised runtimes). Startup behavior was consistent in all cases.
Why automated tests were not added
This change affects container startup semantics, not application logic. The failure mode occurs before application code runs and depends on how the container process is launched or wrapped.
Unit or integration tests would not meaningfully validate this behavior. Manual runtime verification is the appropriate validation method for this class of change.
Related Issues
activate/sourceChecklist
dev(unless release automation or exceptional maintainer change)Notes
PATHSummary by CodeRabbit