File size: 704 Bytes
fffaa66
a714460
fffaa66
 
 
a714460
fffaa66
 
 
a714460
 
 
 
 
 
 
 
 
df108e9
fffaa66
a714460
df108e9
 
 
 
 
 
a714460
fffaa66
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.10-slim

RUN apt-get update && apt-get install -y \
    git git-lfs ffmpeg libsm6 libxext6 libgl1 && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# set writable caches
ENV HF_HOME=/app/.cache \
    HF_HUB_CACHE=/app/.cache/hub \
    HF_DATASETS_CACHE=/app/.cache/datasets \
    TRANSFORMERS_CACHE=/app/.cache/transformers

RUN mkdir -p /app/.cache/hub /app/.cache/datasets /app/.cache/transformers

# copy code and data
COPY . .

# create non-root user and give it ownership
RUN useradd -m -u 1000 user && chown -R user:user /app
USER user

ENV GRADIO_SERVER_NAME=0.0.0.0
ENV PORT=7860

CMD ["python","app.py"]