# Use Python 3.9 slim image FROM python:3.9-slim # Set working directory WORKDIR /app # Copy requirements first for better Docker layer caching COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY app.py . COPY index.html . COPY login.html . COPY static/ ./static/ # Create directory for any additional files RUN mkdir -p /app # Expose port 7860 (Hugging Face Spaces standard) EXPOSE 7860 # Set environment variables ENV PORT=7860 ENV PYTHONUNBUFFERED=1 # Run the FastAPI application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]