|
FROM python:3.10-slim |
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \ |
|
PYTHONUNBUFFERED=1 \ |
|
TRANSFORMERS_CACHE=/app/.hf_cache \ |
|
HF_HOME=/app/.hf_cache \ |
|
TORCH_HOME=/app/.hf_cache \ |
|
TMPDIR=/app/temp_files |
|
|
|
|
|
WORKDIR /app |
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
git \ |
|
libsndfile1 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
ffmpeg \ |
|
git \ |
|
curl \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN mkdir -p /app/temp_files /app/.hf_cache && \ |
|
chmod -R 777 /app/temp_files /app/.hf_cache |
|
|
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir --upgrade pip && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN chmod -R 777 /app |
|
|
|
|
|
|
|
EXPOSE 7860 |
|
CMD ["python", "-m", "gunicorn", "-w", "1", "--bind", "0.0.0.0:7860", "app:app"] |
|
|