| FROM python:3.10-slim |
|
|
| |
| ENV PYTHON_VERSION=3.10 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| libsndfile1 \ |
| ffmpeg \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 appuser |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py . |
| COPY tts_engine.py . |
| COPY file_handler.py . |
| COPY setup_speakers.py . |
| COPY README.md . |
|
|
| |
| RUN mkdir -p speakers temp_audio && \ |
| chown -R appuser:appuser /app |
|
|
| |
| USER appuser |
|
|
| |
| RUN python setup_speakers.py |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=120s \ |
| CMD python -c "import requests; requests.get('http://localhost:7860')" || exit 1 |
|
|
| |
| CMD ["python", "app.py"] |