FROM python:3.11-slim

WORKDIR /app

# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    libpq-dev \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY pyproject.toml .
RUN pip install --no-cache-dir -e .

# Copy app code
COPY . .

# Create upload dirs
RUN mkdir -p uploads/step_files uploads/excel_files uploads/thumbnails

COPY start.sh /start.sh
RUN chmod +x /start.sh

EXPOSE 8000
