Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Update Dockerfile
Browse files- Dockerfile +5 -12
 
    	
        Dockerfile
    CHANGED
    
    | 
         @@ -5,25 +5,18 @@ WORKDIR /app 
     | 
|
| 5 | 
         
             
            # Install system dependencies
         
     | 
| 6 | 
         
             
            RUN apt-get update && apt-get install -y --no-install-recommends \
         
     | 
| 7 | 
         
             
                gcc \
         
     | 
| 8 | 
         
            -
                curl \
         
     | 
| 9 | 
         
             
                && rm -rf /var/lib/apt/lists/*
         
     | 
| 10 | 
         | 
| 11 | 
         
             
            # Copy requirements and install
         
     | 
| 12 | 
         
             
            COPY requirements.txt .
         
     | 
| 13 | 
         
             
            RUN pip install --no-cache-dir -r requirements.txt
         
     | 
| 14 | 
         | 
| 15 | 
         
            -
            # Copy application files
         
     | 
| 16 | 
         
            -
            COPY . .
         
     | 
| 
         | 
|
| 17 | 
         | 
| 18 | 
         
            -
            #  
     | 
| 19 | 
         
            -
            RUN python download_model.py
         
     | 
| 20 | 
         
            -
             
     | 
| 21 | 
         
            -
            # Expose port (HF Spaces uses 8000 by default)
         
     | 
| 22 | 
         
             
            EXPOSE 8000
         
     | 
| 23 | 
         | 
| 24 | 
         
            -
            #  
     | 
| 25 | 
         
            -
            HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
         
     | 
| 26 | 
         
            -
              CMD curl -f http://localhost:8000/health || exit 1
         
     | 
| 27 | 
         
            -
             
     | 
| 28 | 
         
            -
            # Start server
         
     | 
| 29 | 
         
             
            CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]
         
     | 
| 
         | 
|
| 5 | 
         
             
            # Install system dependencies
         
     | 
| 6 | 
         
             
            RUN apt-get update && apt-get install -y --no-install-recommends \
         
     | 
| 7 | 
         
             
                gcc \
         
     | 
| 
         | 
|
| 8 | 
         
             
                && rm -rf /var/lib/apt/lists/*
         
     | 
| 9 | 
         | 
| 10 | 
         
             
            # Copy requirements and install
         
     | 
| 11 | 
         
             
            COPY requirements.txt .
         
     | 
| 12 | 
         
             
            RUN pip install --no-cache-dir -r requirements.txt
         
     | 
| 13 | 
         | 
| 14 | 
         
            +
            # Copy application files (model will download on first startup)
         
     | 
| 15 | 
         
            +
            COPY api.py .
         
     | 
| 16 | 
         
            +
            COPY trained_model ./trained_model
         
     | 
| 17 | 
         | 
| 18 | 
         
            +
            # Expose port
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 19 | 
         
             
            EXPOSE 8000
         
     | 
| 20 | 
         | 
| 21 | 
         
            +
            # Start server (model downloads during first startup, cached for future restarts)
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 22 | 
         
             
            CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"]
         
     |