iyadalagha commited on
Commit
b18de50
·
1 Parent(s): e82d391

Fix uvicorn not found by updating Dockerfile PATH and dependencies

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -0
Dockerfile CHANGED
@@ -11,10 +11,19 @@ USER myuser
11
  # Set Hugging Face cache directory
12
  ENV HF_HOME=/app/.cache/huggingface
13
 
 
 
 
14
  # Copy requirements.txt and install dependencies
15
  COPY --chown=myuser:myuser requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
 
 
 
 
 
 
18
  # Copy the application code
19
  COPY --chown=myuser:myuser . .
20
 
 
11
  # Set Hugging Face cache directory
12
  ENV HF_HOME=/app/.cache/huggingface
13
 
14
+ # Update PATH to include user’s local bin (where pip installs uvicorn)
15
+ ENV PATH="/home/myuser/.local/bin:${PATH}"
16
+
17
  # Copy requirements.txt and install dependencies
18
  COPY --chown=myuser:myuser requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Explicitly install uvicorn to ensure it’s available
22
+ RUN pip install --no-cache-dir uvicorn
23
+
24
+ # Pre-download the model to avoid runtime issues
25
+ RUN python -c "from transformers import pipeline; pipeline('text-classification', model='roberta-base-openai-detector')"
26
+
27
  # Copy the application code
28
  COPY --chown=myuser:myuser . .
29