mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
Address Dockerfile caching and dockerignore cleanup
This commit is contained in:
@@ -32,8 +32,6 @@ logs
|
|||||||
|
|
||||||
# jetbrains
|
# jetbrains
|
||||||
.idea
|
.idea
|
||||||
.mypy_cache
|
|
||||||
.ruff_cache
|
|
||||||
|
|
||||||
# venv
|
# venv
|
||||||
.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
|
# Pre-fetch NLTK data and warm tiktoken cache before copying source to maximize layer reuse
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
mkdir -p /usr/local/share/nltk_data; \
|
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')"; \
|
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; \
|
chmod -R 755 /usr/local/share/nltk_data; \
|
||||||
<<<<<<< HEAD
|
python -c "import tiktoken; tiktoken.encoding_for_model('gpt2')" \
|
||||||
python - <<'PY' \
|
&& chown -R dify:dify ${TIKTOKEN_CACHE_DIR}
|
||||||
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 source code
|
||||||
COPY --chown=dify:dify . /app/api/
|
COPY --chown=dify:dify . /app/api/
|
||||||
|
|
||||||
# Prepare entrypoint script
|
# Prepare entrypoint script
|
||||||
COPY --chown=dify:dify --chmod=755 docker/entrypoint.sh /entrypoint.sh
|
COPY --chown=dify:dify --chmod=755 docker/entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user