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