Skip to content

📚 fix: Fail Docker Builds on NLTK Download Errors - #315

Merged
danny-avila merged 2 commits into
mainfrom
danny-avila/pr-311-review-fixes
Jul 31, 2026
Merged

danny-avila merged 2 commits into
mainfrom
danny-avila/pr-311-review-fixes

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

I fixed NLTK data provisioning during Docker builds and made both image variants fail immediately when any required package cannot be downloaded.

  • Set NLTK_DATA before the download layer in Dockerfile and Dockerfile.lite.
  • Replace the NLTK downloader CLI with explicit nltk.download(...) result checks and a nonzero process exit on failure.
  • Retain build-time installation of punkt_tab, averaged_perceptron_tagger, and averaged_perceptron_tagger_eng.
  • Preserve Peter Rothlaender's original fix: NLTK data download during Docker builds #311 commit and add the focused Codex-review fix as a separate commit.
  • Supersede fix: NLTK data download during Docker builds #311 because its organization-owned fork does not allow maintainer pushes.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • Built the full image with docker build --file Dockerfile ..
  • Built the lite image with docker build --file Dockerfile.lite ..
  • Confirmed both images contain all three required NLTK resources under /app/nltk_data.
  • Confirmed a nonexistent package returns status 1 so Docker cannot publish an incomplete image.
  • Rebuilt both images with the dependency updates merged in 🛡️ fix: Patch pypdf and cryptography Security Alerts #314.

Test Configuration:

  • Docker 29.4.0
  • Full image: python:3.12
  • Lite image: python:3.12-slim

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local Docker build validation passes with my changes

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 3611ca31ef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila
danny-avila merged commit 5819a34 into main Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant