FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && useradd --create-home --uid 10001 appuser
COPY chat_mvp ./chat_mvp
COPY static ./static
COPY scripts ./scripts
COPY source.zip LICENSE README.md ./
RUN mkdir -p /app/data && chown -R appuser:appuser /app
USER appuser
EXPOSE 8787
CMD ["python", "-m", "chat_mvp"]
