# LLMGuardian Docker Image FROM python:3.11-slim # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements files COPY requirements/ /app/requirements/ COPY requirements-full.txt /app/ # Install Python dependencies RUN pip install --upgrade pip && \ pip install -r requirements-full.txt # Copy source code COPY src/ /app/src/ COPY setup.py /app/ COPY pyproject.toml /app/ COPY README.md /app/ COPY LICENSE /app/ # Install the package RUN pip install -e . # Create necessary directories RUN mkdir -p /app/logs /app/data /app/.cache # Expose ports for API and Dashboard EXPOSE 8000 8501 # Add health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1 # Default command (can be overridden) CMD ["python", "-m", "llmguardian.api.app"]