
FROM python:3.12-slim

WORKDIR /code
COPY ./ ./

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

RUN pip install --no-cache-dir -r requirements.txt
RUN if [ -f stitch_bridge/package-lock.json ]; then cd stitch_bridge && npm ci --omit=dev; fi

EXPOSE 8000

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
