fix(docker): fail fast on build patch failures and add healthcheck - #2
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix(docker): fail fast on build patch failures and add healthcheck#2devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The repo is just a Dockerfile, so the error-handling gaps are all in the build/run of the image. The dangerous ones are the
sedpatches:sedexits 0 when its pattern matches nothing, so if upstreamnutv3.3 ever changesconf/nut.default.conforrequirements.txt, the build still succeeds and ships an image that scans the wrong directory or tries to install PyQt5 — a silent misconfiguration discovered only at runtime. Each patch now asserts its own result:Other propagation fixes:
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]so any future chained/pipedRUNfails the build instead of returning the last command's status.apt-get autoremove→apt-get -y autoremove(previously it aborted with "Need to get..."/prompt semantics rather than doing its job) plusapt-get cleanand removal of apt lists.test -f /root/nut/nut.pyafter extraction, so a changed archive layout fails at build time rather than as a container crash loop.PYTHONUNBUFFERED=1/PYTHONFAULTHANDLER=1: tracebacks and fatal signals are otherwise buffered away and lost fromdocker logswhen the server dies.HEALTHCHECKTCP-connects to 9000, so a dead or wedged server is reported instead of the container looking fine.--start-period=180scovers titledb loading (~90s observed).wget -O /tmp/nut.zip --tries=3,unzip -q,--no-install-recommends,--no-cache-dir.Verification
docker buildsucceeds;nut.confcontains"scan": ["/titles"].health=healthyafter startup, logsServer Starts - 0.0.0.0:9000.sedpattern that matches nothing now fails the build (exit code: 1) instead of passing silently.Link to Devin session: https://app.devin.ai/sessions/166162ba454e4104bfe8ced74f39bb9a
Requested by: @eskwisit