| FROM python:3.9-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends \ |
| gcc \ |
| python3-dev \ |
| ffmpeg \ |
| libimage-exiftool-perl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py text2generation.py video_processor.py ./ |
|
|
| |
| ENV TRANSFORMERS_CACHE=/tmp/cache \ |
| HF_HOME=/tmp/cache \ |
| PYTHONUNBUFFERED=1 |
|
|
| |
| RUN mkdir -p /tmp/cache && \ |
| chmod 777 /tmp/cache |
|
|
| EXPOSE 7860 |
|
|
| HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| CMD ["python", "app.py"] |