Alexandre-Numind commited on
Commit
9b716ba
·
verified ·
1 Parent(s): 5d59e3c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -7
Dockerfile CHANGED
@@ -11,15 +11,17 @@ ENV GRADIO_SERVER_NAME=0.0.0.0
11
  ENV GRADIO_SERVER_PORT=7860
12
 
13
  ENV VLLM_PORT=8000
14
- ENV MAX_MODEL_LEN=12000
15
  ENV GPU_MEMORY_UTILIZATION=0.90
16
 
17
- ENV NUEXTRACT_MAX_TOKENS=5000
18
  ENV NUEXTRACT_ASSETS_DIR=/home/user/app/assets
19
 
20
- ENV HF_HOME=/data/.cache/huggingface
21
- ENV TRANSFORMERS_CACHE=/data/.cache/huggingface
22
- ENV VLLM_CACHE_ROOT=/data/.cache/vllm
 
 
23
 
24
  RUN pip install --no-cache-dir \
25
  gradio \
@@ -34,14 +36,19 @@ COPY --chown=user:user app.py /home/user/app/app.py
34
  COPY --chown=user:user start.sh /home/user/app/start.sh
35
  COPY --chown=user:user assets /home/user/app/assets
36
 
37
- RUN chown -R user:user /home/user/app && \
 
 
 
 
38
  chmod +x /home/user/app/start.sh
39
 
40
  USER user
41
 
42
  EXPOSE 7860
43
 
44
- # Important: override vllm/vllm-openai's default entrypoint.
 
45
  ENTRYPOINT []
46
 
47
  CMD ["/bin/bash", "/home/user/app/start.sh"]
 
11
  ENV GRADIO_SERVER_PORT=7860
12
 
13
  ENV VLLM_PORT=8000
14
+ ENV MAX_MODEL_LEN=18000
15
  ENV GPU_MEMORY_UTILIZATION=0.90
16
 
17
+ ENV NUEXTRACT_MAX_TOKENS=15000
18
  ENV NUEXTRACT_ASSETS_DIR=/home/user/app/assets
19
 
20
+ # Use writable cache dirs. Do not use /data unless persistent storage permissions are fixed.
21
+ ENV HF_HOME=/home/user/.cache/huggingface
22
+ ENV HUGGINGFACE_HUB_CACHE=/home/user/.cache/huggingface/hub
23
+ ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface
24
+ ENV VLLM_CACHE_ROOT=/home/user/.cache/vllm
25
 
26
  RUN pip install --no-cache-dir \
27
  gradio \
 
36
  COPY --chown=user:user start.sh /home/user/app/start.sh
37
  COPY --chown=user:user assets /home/user/app/assets
38
 
39
+ RUN mkdir -p \
40
+ /home/user/.cache/huggingface/hub \
41
+ /home/user/.cache/vllm \
42
+ /home/user/app/assets && \
43
+ chown -R user:user /home/user && \
44
  chmod +x /home/user/app/start.sh
45
 
46
  USER user
47
 
48
  EXPOSE 7860
49
 
50
+ # Required because vllm/vllm-openai has its own entrypoint.
51
+ # Without this, it treats start.sh as the model path.
52
  ENTRYPOINT []
53
 
54
  CMD ["/bin/bash", "/home/user/app/start.sh"]