lailaelkoussy/code-knowledge-graph-explorer-transformers-library
0
1FROM python:3.13-slim2 3# Set environment variables4ENV PYTHONUNBUFFERED=15ENV PYTHONDONTWRITEBYTECODE=16ENV GRADIO_SERVER_NAME=0.0.0.07ENV GRADIO_SERVER_PORT=78608 9# System dependencies10RUN apt-get update && apt-get install -y --no-install-recommends \11 clang \12 llvm-dev \13 build-essential \14 curl \15 git \16 pkg-config \17 wget \18 ca-certificates \19 && rm -rf /var/lib/apt/lists/*20 21# Create a non-root user for HuggingFace Spaces22RUN useradd -m -u 1000 user23WORKDIR /app24 25# Copy requirements first for better caching26COPY requirements.txt /app/requirements.txt27 28# Install Python dependencies29RUN pip install --no-cache-dir -r /app/requirements.txt && \30 pip install --no-cache-dir libclang31 32# Copy application code (excluding large data files)33COPY --chown=user:user . /app34 35# Set ownership36RUN chown -R user:user /app37 38# Switch to non-root user39USER user40 41# Expose the Gradio port42EXPOSE 786043 44# Default command - can be overridden to use --hf-dataset instead of --graph-file45# To use HuggingFace dataset: --hf-dataset "username/dataset-name"46# To use local file: --graph-file "/app/data/multihop_knowledge_graph_with_embeddings.json"47CMD ["python", "-u", "gradio_mcp_space.py"]48 