From ae3caa61605a6a87fd8194a92c9fc0c6275b4de0 Mon Sep 17 00:00:00 2001 From: -LAN- Date: Thu, 27 Nov 2025 23:08:04 +0800 Subject: [PATCH] Address Dockerfile caching and dockerignore cleanup --- api/.dockerignore | 2 -- api/Dockerfile | 37 ++----------------------------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/api/.dockerignore b/api/.dockerignore index f24f11edf0..cc64f25b0a 100644 --- a/api/.dockerignore +++ b/api/.dockerignore @@ -32,8 +32,6 @@ logs # jetbrains .idea -.mypy_cache -.ruff_cache # venv .venv diff --git a/api/Dockerfile b/api/Dockerfile index 0d94a438fe..6879cf8ffb 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -88,46 +88,13 @@ ENV TIKTOKEN_CACHE_DIR=/app/api/.tiktoken_cache # Pre-fetch NLTK data and warm tiktoken cache before copying source to maximize layer reuse RUN set -eux; \ mkdir -p /usr/local/share/nltk_data; \ -<<<<<<< HEAD - NLTK_DATA=/usr/local/share/nltk_data python - <<'PY' \ -import nltk -nltk.download('punkt') -nltk.download('averaged_perceptron_tagger') -nltk.download('stopwords') -PY - ; \ -||||||| parent of 256c4f4fcc (Simplify Dockerfile download commands) - NLTK_DATA=/usr/local/share/nltk_data python - <<'PY' -import nltk -nltk.download('punkt') -nltk.download('averaged_perceptron_tagger') -nltk.download('stopwords') -PY - ; \ -======= NLTK_DATA=/usr/local/share/nltk_data python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger'); nltk.download('stopwords')"; \ ->>>>>>> 256c4f4fcc (Simplify Dockerfile download commands) chmod -R 755 /usr/local/share/nltk_data; \ -<<<<<<< HEAD - python - <<'PY' \ -import tiktoken -tiktoken.encoding_for_model('gpt2') -PY - ; \ - chown -R dify:dify ${TIKTOKEN_CACHE_DIR} -||||||| parent of 256c4f4fcc (Simplify Dockerfile download commands) - python - <<'PY' -import tiktoken -tiktoken.encoding_for_model('gpt2') -PY - ; -======= - python -c "import tiktoken; tiktoken.encoding_for_model('gpt2')" ->>>>>>> 256c4f4fcc (Simplify Dockerfile download commands) + python -c "import tiktoken; tiktoken.encoding_for_model('gpt2')" \ + && chown -R dify:dify ${TIKTOKEN_CACHE_DIR} # Copy source code COPY --chown=dify:dify . /app/api/ - # Prepare entrypoint script COPY --chown=dify:dify --chmod=755 docker/entrypoint.sh /entrypoint.sh