Omkar1806 commited on
Commit
45730bd
·
verified ·
1 Parent(s): 532f720

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -15
Dockerfile CHANGED
@@ -1,22 +1,19 @@
1
- FROM python:3.11-slim
2
-
3
- # User setup for Hugging Face
4
- RUN useradd -m -u 1000 user
5
- USER user
6
- ENV PATH="/home/user/.local/bin:${PATH}"
7
 
 
8
  WORKDIR /app
9
 
10
- # Copy and install as user
11
- COPY --chown=user requirements.txt .
12
- RUN pip install --no-cache-dir --user -r requirements.txt
13
 
14
- # Copy all project files
15
- COPY --chown=user . .
16
 
17
- # Expose port
18
  EXPOSE 7860
19
 
20
- # --- YAHAN CHANGE HAI ---
21
- # Direct uvicorn ki jagah hum python module run karenge jo main() ko call karega
22
- CMD ["python", "-m", "server.app"]
 
1
+ # 1. Base image (Python 3.9 use kar rahe hain jo stable hai)
2
+ FROM python:3.9-slim
 
 
 
 
3
 
4
+ # 2. Working directory set karo
5
  WORKDIR /app
6
 
7
+ # 3. Pehle requirements copy karo aur install karo (Cache optimize karne ke liye)
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # 4. Saara code copy karo
12
+ COPY . .
13
 
14
+ # 5. Hugging Face ka port 7860 hota hai
15
  EXPOSE 7860
16
 
17
+ # 6. App ko run karne ki command
18
+ # Hum uvicorn use kar rahe hain taaki app zinda rahe (Exit code 0 na aaye)
19
+ CMD ["python", "app.py"]