# Use Python 3.9 as base image FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements file COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Create necessary directories with proper permissions RUN mkdir -p /app/uploads \ /app/predictions \ && chmod -R 777 /app/uploads \ /app/predictions # Copy the application code and utilities COPY . /app/ COPY ../voting.py /app/ COPY ../config.py /app/ COPY ../dataset_utils.py /app/ COPY ../label_encoders.pkl /app/ # Set environment variables ENV PYTHONPATH=/app ENV PYTHONUNBUFFERED=1 ENV PORT=7861 # Expose the port the app runs on EXPOSE 7861 # Command to run the application CMD ["python", "app.py"]