# Stentor Gateway — Multi-stage Dockerfile # Builds a minimal production image for the voice gateway. # --- Build stage --- FROM python:3.12-slim AS builder WORKDIR /build # Install uv for fast dependency resolution COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv # Copy project files COPY pyproject.toml . COPY src/ src/ # Install dependencies into a virtual environment RUN uv venv /opt/venv && \ uv pip install --python /opt/venv/bin/python . --no-cache # --- Runtime stage --- FROM python:3.12-slim AS runtime LABEL maintainer="robert" LABEL description="Stentor Gateway — Voice gateway for AI agents" LABEL version="0.1.0" # Copy virtual environment from builder COPY --from=builder /opt/venv /opt/venv # Copy application source (for templates/static) COPY src/ /app/src/ WORKDIR /app # Use the venv Python ENV PATH="/opt/venv/bin:$PATH" ENV PYTHONPATH="/app/src" ENV PYTHONUNBUFFERED=1 # Default configuration ENV STENTOR_HOST=0.0.0.0 ENV STENTOR_PORT=8600 EXPOSE 8600 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD python -c "import httpx; r = httpx.get('http://localhost:8600/api/live/'); r.raise_for_status()" CMD ["uvicorn", "stentor.main:app", "--host", "0.0.0.0", "--port", "8600"]