gabrielchua commited on
Commit
2783dfd
·
verified ·
1 Parent(s): 8600717

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -1
Dockerfile CHANGED
@@ -23,6 +23,13 @@ COPY --chown=user requirements.txt .
23
  RUN pip install --no-cache-dir --upgrade pip && \
24
  pip install --no-cache-dir -r requirements.txt
25
 
 
 
 
 
 
 
 
26
  # Copy the rest of the application code
27
  COPY --chown=user . .
28
 
@@ -32,4 +39,4 @@ EXPOSE 7860
32
  # Run the FastAPI app from the backend directory so local imports resolve
33
  WORKDIR $HOME/app/app/backend
34
 
35
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
23
  RUN pip install --no-cache-dir --upgrade pip && \
24
  pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Pre-download the SentenceTransformer embedding model to avoid runtime cold-starts
27
+ RUN python - <<'PY'
28
+ from sentence_transformers import SentenceTransformer
29
+
30
+ SentenceTransformer("google/embeddinggemma-300m")
31
+ PY
32
+
33
  # Copy the rest of the application code
34
  COPY --chown=user . .
35
 
 
39
  # Run the FastAPI app from the backend directory so local imports resolve
40
  WORKDIR $HOME/app/app/backend
41
 
42
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]