FROM python:3.12-slim
RUN useradd --system --uid 10001 --create-home tenant-engine
WORKDIR /app
COPY pyproject.toml README.md LICENSE ./
COPY src ./src
COPY migrations ./migrations
RUN pip install --no-cache-dir ".[postgres]"
USER 10001
EXPOSE 8090
ENV TENANT_ENGINE_HOST=0.0.0.0 TENANT_ENGINE_HTTP_PORT=8090
CMD ["tenant-engine"]
