| FROM python:3.11-slim | |
| # Install system dependencies required for OpenCV and pyzbar (barcodes) | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libzbar0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN pip install --no-cache-dir fastapi uvicorn python-multipart | |
| # Copy all project files | |
| COPY . . | |
| # Create directories if they don't exist | |
| RUN mkdir -p temp_uploads results images/barcode images/chassis | |
| # Expose FastAPI port | |
| EXPOSE 7860 | |
| # Start application | |
| CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] |