findEthics/Atlas
0
1# Use Python 3.9 slim image for efficiency2FROM python:3.9-slim3 4# Install build dependencies needed for ML packages (chromadb, sentence-transformers, blis)5RUN apt-get update && apt-get install -y \6 build-essential \7 python3-dev \8 gcc \9 g++ \10 libc6-dev \11 libffi-dev \12 libssl-dev \13 && rm -rf /var/lib/apt/lists/*14 15# Create a non-root user for security16RUN useradd -m -u 1000 user17USER user18 19# Set environment variables20ENV PATH="/home/user/.local/bin:$PATH"21ENV PYTHONPATH="/app:$PYTHONPATH"22 23# Set working directory24WORKDIR /app25 26# Copy requirements file with proper ownership27COPY --chown=user requirements.txt requirements.txt28 29# Install Python dependencies with better wheel support30RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \31 pip install --no-cache-dir --prefer-binary --upgrade -r requirements.txt32 33# Copy application code34COPY --chown=user app.py /app/35COPY --chown=user . /app/36 37# Expose port 7860 for Hugging Face Spaces38EXPOSE 786039 40# Command to run the application41CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]