AUXteam/Critical_Code_Agent
0
1# Use an official Python runtime as a parent image2FROM python:3.11-slim-bullseye3 4# Set environment variables5ENV PYTHONUNBUFFERED=1 \6 PYTHONDONTWRITEBYTECODE=1 \7 DEBIAN_FRONTEND=noninteractive \8 PYTHONPATH=.:CriticalThinking9 10# Install system dependencies11RUN apt-get update && apt-get install -y --no-install-recommends \12 build-essential \13 git \14 wget \15 && rm -rf /var/lib/apt/lists/*16 17# Set working directory18WORKDIR /app19 20# Install uv and requirements21COPY CriticalThinking/requirements.txt .22RUN pip install --no-cache-dir uv && \23 uv pip install --system --no-cache-dir -r requirements.txt && \24 uv pip install --system --no-cache-dir gradio uvicorn25 26# Create a non-root user and switch to it27# Hugging Face Spaces use a user with UID 100028RUN useradd -m -u 1000 user29USER user30ENV PATH="/home/user/.local/bin:$PATH"31WORKDIR /home/user/app32 33# Copy the rest of the application34# Use --chown=user to ensure the user has permissions35COPY --chown=user . .36 37# Expose the port38EXPOSE 786039 40# Command to run the application41# We use uvicorn to run the hf_app:app42CMD ["uvicorn", "hf_app:app", "--host", "0.0.0.0", "--port", "7860"]43 