AnshulS commited on
Commit
72f82eb
·
verified ·
1 Parent(s): dbd8583

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -22
Dockerfile CHANGED
@@ -1,27 +1,10 @@
1
- # Use Python base image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables
5
- ENV HF_HOME=/app/hf_cache
6
- ENV TRANSFORMERS_CACHE=/app/hf_cache
7
- ENV SENTENCE_TRANSFORMERS_HOME=/app/hf_cache
8
-
9
- # Install system deps
10
- RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
11
-
12
- # Install Python deps
13
- COPY requirements.txt .
14
- RUN pip install --no-cache-dir -r requirements.txt
15
-
16
- # Pre-download the model
17
- RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
18
-
19
- # Copy app code
20
- COPY . /app
21
  WORKDIR /app
 
22
 
23
- # Expose port
24
- EXPOSE 7860
25
 
26
- # Start the app
27
- CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ ENV PORT 7860
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  WORKDIR /app
5
+ COPY . .
6
 
7
+ RUN pip install --no-cache-dir --upgrade pip && \
8
+ pip install --no-cache-dir -r requirements.txt
9
 
10
+ CMD ["uvicorn", "webapp:app", "--host", "0.0.0.0", "--port", "7860"]