FROM python:3.13-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better layer caching
COPY requirements.txt .

# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy entrypoint script
COPY entrypoints/startup.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Copy application code (will be overridden by volume mount in development)
COPY . .

ENTRYPOINT ["/entrypoint.sh"]
