| |
| |
| |
| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| ffmpeg libsndfile1 git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . . |
|
|
| |
| RUN pip install --no-cache-dir . |
|
|
| |
| RUN useradd -m appuser |
| USER appuser |
|
|
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \ |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/')" || exit 1 |
|
|
| CMD ["python", "app.py"] |
|
|