abhinav337463 commited on
Commit
60375dd
·
verified ·
1 Parent(s): 755efa1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -19
Dockerfile CHANGED
@@ -1,24 +1,16 @@
1
- # Python 3.10 का उपयोग करें (.bit_count() के लिए ज़रूरी)
2
- FROM python:3.10-slim
3
 
4
- # सिस्टम डिपेंडेंसी इंस्टॉल करें (fasttext के लिए gcc/g++ ज़रूरी है)
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- && rm -rf /var/lib/apt/lists/*
9
 
10
- # वर्किंग डायरेक्टरी सेट करें
11
- WORKDIR /app
 
12
 
13
- # पहले रिक्वायरमेंट्स कॉपी और इंस्टॉल करें (Caching के लिए बेहतर)
14
- COPY requirements.txt .
15
- RUN pip install --no-cache-dir -r requirements.txt
16
-
17
- # बाकी कोड कॉपी करें
18
  COPY . .
19
 
20
- # पोर्ट 7860 (HF Spaces का डिफॉल्ट) एक्सपोज करें
21
- EXPOSE 7860
22
-
23
- # ऐप शुरू करें
24
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 1. Python ka base image use karo
2
+ FROM python:3.9
3
 
4
+ # 2. Working directory set karo
5
+ WORKDIR /code
 
 
 
6
 
7
+ # 3. Pehle requirements copy karo aur install karo
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # 4. Baaki saara code copy karo
 
 
 
 
12
  COPY . .
13
 
14
+ # 5. Flask app ko start karne ka command
15
+ # Hugging Face Spaces port 7860 use karta hai
16
+ CMD ["python", "app.py"]