Spaces:
Paused
Paused
File size: 1,168 Bytes
ab5e1a7 6e71d09 ab5e1a7 | 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 | # Production Dockerfile for Public Speaking Coach API
# Optimized for Hugging Face Spaces or any cloud deployment
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
libsndfile1 \
git \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
ENV OMP_NUM_THREADS=1
WORKDIR /app
# Copy requirements first (for better caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install uvicorn
# Copy application code
COPY kid_coach_pipeline.py .
COPY main.py .
COPY index.html .
# Create directory for temporary files
RUN mkdir -p /tmp/uploads
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import requests; requests.get('http://localhost:7860/health')"
# Run the application
# Use port 7860 for Hugging Face Spaces compatibility
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |