File size: 733 Bytes
f84ed9c
724013d
f84ed9c
 
 
7158b5e
 
 
f84ed9c
724013d
7158b5e
724013d
 
 
 
7158b5e
f84ed9c
7158b5e
724013d
7158b5e
 
 
f84ed9c
 
 
7158b5e
f84ed9c
724013d
7158b5e
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
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    TMP_DIR=/tmp/uploads \
    PORT=7860 \
    HF_HOME=/tmp/huggingface \
    TRANSFORMERS_CACHE=/tmp/huggingface

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    ffmpeg libsndfile1 git build-essential wget curl redis-server && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt rq

COPY . .
COPY start.sh /start.sh
RUN chmod +x /start.sh && mkdir -p ${TMP_DIR}

EXPOSE ${PORT}

HEALTHCHECK --interval=30s --timeout=3s --start-period=15s \
  CMD curl -f http://localhost:${PORT}/health || exit 1

CMD ["/start.sh"]