FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ g++ \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements_api.txt . RUN pip install --no-cache-dir -r requirements_api.txt # Copy application files COPY app_clean.py app.py COPY ocr_with_gemini_clean.py ocr_with_gemini.py COPY cost_tracker.py . COPY static/ ./static/ # Create necessary directories with proper permissions RUN mkdir -p /tmp/uploads && chmod 777 /tmp/uploads # Expose port EXPOSE 7860 # Set environment variables ENV PYTHONUNBUFFERED=1 # Note: GOOGLE_APPLICATION_CREDENTIALS will be provided as Hugging Face secret # Do NOT copy myfinance_key.json - use the secret instead # Run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]