FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home ui
COPY server.py index.html ./
COPY static ./static
USER ui
EXPOSE 8787
CMD ["uvicorn", "server:create_app", "--factory", "--host", "0.0.0.0", "--port", "8787", "--workers", "1", "--no-access-log"]
