Update Dockerfile
Browse files- Dockerfile +6 -9
 
    	
        Dockerfile
    CHANGED
    
    | 
         @@ -1,28 +1,25 @@ 
     | 
|
| 1 | 
         
            -
            # Use official Python base image
         
     | 
| 2 | 
         
             
            FROM python:3.9-slim
         
     | 
| 3 | 
         | 
| 4 | 
         
            -
            # Install system dependencies
         
     | 
| 5 | 
         
             
            RUN apt-get update && apt-get install -y \
         
     | 
| 6 | 
         
            -
                build-essential \
         
     | 
| 7 | 
         
             
                libgl1-mesa-glx \
         
     | 
| 8 | 
         
             
                libglib2.0-0 \
         
     | 
| 9 | 
         
             
                libsm6 \
         
     | 
| 10 | 
         
             
                libxext6 \
         
     | 
| 11 | 
         
            -
                 
     | 
| 12 | 
         
            -
                ffmpeg \
         
     | 
| 13 | 
         
             
                && rm -rf /var/lib/apt/lists/*
         
     | 
| 14 | 
         | 
| 15 | 
         
             
            # Set working directory
         
     | 
| 16 | 
         
             
            WORKDIR /app
         
     | 
| 17 | 
         | 
| 18 | 
         
            -
            # Copy  
     | 
| 19 | 
         
             
            COPY . /app
         
     | 
| 20 | 
         | 
| 21 | 
         
             
            # Install Python dependencies
         
     | 
| 22 | 
         
            -
            RUN pip install --no-cache-dir fastapi uvicorn numpy opencv-python-headless  
     | 
| 23 | 
         | 
| 24 | 
         
            -
            # Expose port
         
     | 
| 25 | 
         
             
            EXPOSE 7860
         
     | 
| 26 | 
         | 
| 27 | 
         
            -
            #  
     | 
| 28 | 
         
             
            CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
         
     | 
| 
         | 
|
| 
         | 
|
| 1 | 
         
             
            FROM python:3.9-slim
         
     | 
| 2 | 
         | 
| 3 | 
         
            +
            # Install only necessary system dependencies for OpenCV and image processing
         
     | 
| 4 | 
         
             
            RUN apt-get update && apt-get install -y \
         
     | 
| 
         | 
|
| 5 | 
         
             
                libgl1-mesa-glx \
         
     | 
| 6 | 
         
             
                libglib2.0-0 \
         
     | 
| 7 | 
         
             
                libsm6 \
         
     | 
| 8 | 
         
             
                libxext6 \
         
     | 
| 9 | 
         
            +
                libxrender1 \
         
     | 
| 
         | 
|
| 10 | 
         
             
                && rm -rf /var/lib/apt/lists/*
         
     | 
| 11 | 
         | 
| 12 | 
         
             
            # Set working directory
         
     | 
| 13 | 
         
             
            WORKDIR /app
         
     | 
| 14 | 
         | 
| 15 | 
         
            +
            # Copy files
         
     | 
| 16 | 
         
             
            COPY . /app
         
     | 
| 17 | 
         | 
| 18 | 
         
             
            # Install Python dependencies
         
     | 
| 19 | 
         
            +
            RUN pip install --no-cache-dir fastapi uvicorn numpy opencv-python-headless Pillow
         
     | 
| 20 | 
         | 
| 21 | 
         
            +
            # Expose FastAPI port
         
     | 
| 22 | 
         
             
            EXPOSE 7860
         
     | 
| 23 | 
         | 
| 24 | 
         
            +
            # Run the app
         
     | 
| 25 | 
         
             
            CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
         
     |