tmt3103 commited on
Commit
6635965
·
1 Parent(s): 8d802f2

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -9
Dockerfile CHANGED
@@ -1,26 +1,23 @@
1
  FROM python:3.9-slim
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Copy dependencies
7
- COPY requirements.txt ./
8
 
9
- # Install dependencies
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Hugging Face cache directory
13
  ENV HF_HOME=/app/.cache
14
  RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
15
 
16
- # Pre-download model to cache
17
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
18
 
19
- # Copy rest of the project
20
  COPY . .
21
 
22
- # Expose the port expected by HF Spaces
23
  EXPOSE 8080
24
 
25
- # Run app
26
  CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Copy requirements + setup.py
6
+ COPY requirements.txt setup.py ./
7
 
8
+ # dependencies
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Hugging Face cache
12
  ENV HF_HOME=/app/.cache
13
  RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
14
 
15
+ # Pre-download model
16
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')"
17
 
 
18
  COPY . .
19
 
20
+ # Expose port Hugging Face
21
  EXPOSE 8080
22
 
 
23
  CMD ["python", "app.py"]