Spaces:
Runtime error
Runtime error
File size: 1,162 Bytes
1e94b85 8bc88a1 1e94b85 8bc88a1 1e94b85 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | # 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"]
|