mirror of https://github.com/langgenius/dify.git
Address Dockerfile caching and dockerignore cleanup
This commit is contained in:
parent
849e86ee6a
commit
ae3caa6160
|
|
@ -32,8 +32,6 @@ logs
|
|||
|
||||
# jetbrains
|
||||
.idea
|
||||
.mypy_cache
|
||||
.ruff_cache
|
||||
|
||||
# venv
|
||||
.venv
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue