CoolFace
Apppublic

Sachin-kumar/STS

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
Dockerfile38 linesDownload Raw Back to root
1FROM python:3.13-slim2 3# Set work directory4WORKDIR /app5 6# Ensure no interactive prompts7ENV DEBIAN_FRONTEND=noninteractive8 9# Install system dependencies10RUN apt-get update && apt-get install -y --no-install-recommends \11    git \12    && rm -rf /var/lib/apt/lists/*13 14# Set Hugging Face cache to a writeable location15ENV HF_HOME=/app/hf_cache16ENV TRANSFORMERS_CACHE=/app/hf_cache17 18# Install Python dependencies19COPY requirements.txt .20RUN pip install --no-cache-dir -r requirements.txt \21    && pip install --no-cache-dir uvicorn sentence-transformers22 23# Pre-download the model to cache24RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('LaBSE')"25 26# Copy application code27COPY . .28 29# Expose port for Hugging Face30EXPOSE 786031 32# Run as non-root user (preferred on HF Spaces)33RUN useradd -m appuser34USER appuser35 36# Start app37CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]38