Spaces:
Runtime error
Runtime error
File size: 875 Bytes
62f57ec 93b86bb 8b58140 b0bdfc9 93b86bb 62f57ec 0587027 | 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 | # Hugging Face Spaces Docker
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
curl \
git \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
ENV HOME="/home/user"
WORKDIR /app
# Copy requirements first for better caching
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy application files
COPY --chown=user . /app
# Create necessary directories
RUN mkdir -p /app/instance /app/tts_cache /app/audio_cache
# Set environment variables for HF Spaces
ENV FLASK_ENV=production
ENV IS_SPACES=true
ENV PORT=7860
# Expose port
EXPOSE 7860
# Run with waitress (already in requirements.txt)
CMD ["python", "app.py"]
|