adold/queue-storm-classifier
0
1# syntax=docker/dockerfile:1.72# ---------------------------------------------------------------------------3# QueueStorm Ticket Classifier — minimal CPU image4# Base: python:3.11-slim (PRD §13)5# Runs: uvicorn on 0.0.0.0:$APP_PORT (default 8000)6# ---------------------------------------------------------------------------7 8FROM python:3.11-slim AS runtime9 10ENV PYTHONDONTWRITEBYTECODE=1 \11 PYTHONUNBUFFERED=1 \12 PIP_NO_CACHE_DIR=1 \13 PIP_DISABLE_PIP_VERSION_CHECK=1 \14 APP_PORT=8000 \15 LOG_LEVEL=info16 17# Slim images don't bundle curl by default; useful for container healthchecks.18RUN apt-get update \19 && apt-get install -y --no-install-recommends curl \20 && rm -rf /var/lib/apt/lists/*21 22WORKDIR /srv/app23 24# Install dependencies first to maximize layer caching.25COPY requirements.txt ./26RUN pip install -r requirements.txt27 28# Copy the application code.29COPY app ./app30# Copy the entrypoint wrapper for portable LOG_LEVEL lowercasing.31COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh32 33# Run as a non-root user for a small security hardening win.34RUN useradd --create-home --uid 10001 qstorm \35 && chown -R qstorm:qstorm /srv/app36USER qstorm37 38EXPOSE 800039 40HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \41 CMD curl -fsS "http://127.0.0.1:${APP_PORT}/health" || exit 142 43CMD ["docker-entrypoint.sh"] 