mirror of https://github.com/langgenius/dify.git
Simplify Dockerfile download commands
This commit is contained in:
parent
ada9aafe3e
commit
849e86ee6a
|
|
@ -88,6 +88,7 @@ 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')
|
||||
|
|
@ -95,13 +96,34 @@ 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)
|
||||
|
||||
# Copy source code
|
||||
COPY --chown=dify:dify . /app/api/
|
||||
|
|
|
|||
Loading…
Reference in New Issue