# AI Prescription Assistant - Docker Configuration FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ tesseract-ocr \ tesseract-ocr-eng \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ libgomp1 \ libglib2.0-0 \ build-essential \ python3-dev \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . # Install CPU-only PyTorch first (to avoid downloading huge CUDA wheels) RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create necessary directories RUN mkdir -p uploads outputs static/images sample_prescriptions logs # Expose port 7860 for Hugging Face EXPOSE 7860 # Run with uvicorn on port 7860 CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]