Update Dockerfile
Browse files12345678910111213141516171819202122FROM python:3.11-slim# User setup for Hugging FaceRUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:${PATH}"WORKDIR /app# Copy and install as userCOPY --chown=user requirements.txt .RUN pip install --no-cache-dir --user -r requirements.txt# Copy all project filesCOPY --chown=user . .# Expose portEXPOSE 7860# --- YAHAN CHANGE HAI ---# Direct uvicorn ki jagah hum python module run karenge jo main() ko call karegaCMD ["python", "-m", "server.app"]12345678910111213141516171819# 1. Base image (Python 3.9 use kar rahe hain jo stable hai)FROM python:3.9-slim# 2. Working directory set karoWORKDIR /app# 3. Pehle requirements copy karo aur install karo (Cache optimize karne ke liye)COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# 4. Saara code copy karoCOPY . .# 5. Hugging Face ka port 7860 hota haiEXPOSE 7860# 6. App ko run karne ki command# Hum uvicorn use kar rahe hain taaki app zinda rahe (Exit code 0 na aaye)CMD ["python", "app.py"]
Dockerfile+12-15