FROM python:3.11-slim

# Set working dir
WORKDIR /app

# Copy requirements first (for caching)
COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY . .

# Expose Flask port
EXPOSE 3001

# Environment vars
ENV PYTHONUNBUFFERED=1

# Run app
CMD ["python", "app.py"]