download NLTK stopword at image build time instead of container boot

This commit is contained in:
leander committed 2026-10-24 04:56:40 +02:00
1 parent 3c85452aed
commit 196cb8a65b
2 files changed
+5

No files matched your search

+2
View File
@@ -12,6 +12,8 @@ COPY pyproject.toml uv.lock .python-version ./
RUN uv sync --locked --no-dev --no-cache
RUN .venv/bin/python -m nltk.downloader -d /usr/local/share/nltk_data stopwords
COPY . .
ENV PATH="/app/.venv/bin:$PATH"
+3
View File
@@ -45,6 +45,9 @@ class WordCloud(commands.Cog):
self.consenting_users = []
self.populate_consenting_users()
try:
nltk.data.find("corpora/stopwords")
except LookupError:
nltk.download("stopwords")
self.insert_cache_loop.start()