# Core app image — used for both the API server and the Celery worker (see
# docker-compose.yml, which points each service at this image with a different
# `command`). Fine-Tuning (Module 8) is deliberately NOT included here: it needs
# Apple's MLX, which has no Linux wheels — see backend/requirements-macos.txt and the
# README's native macOS setup for that module.
FROM python:3.14-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    && rm -rf /var/lib/apt/lists/*

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

COPY . .
RUN mkdir -p data/uploads data/backups logs

COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh

EXPOSE 8000

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
