File size: 678 Bytes
7244537
 
 
3af3ad1
 
7244537
 
 
 
 
 
 
 
19648b1
31954ed
7244537
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.10-slim

ENV PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    GRADIO_SERVER_NAME=0.0.0.0

WORKDIR /app

RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*

# Install CPU-only torch first (prevents 5GB GPU version download)
RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu

# Install rest (modern compatible versions)
RUN pip install "diffusers>=0.30.0,<0.31" "transformers>=4.44.0,<4.45" "accelerate>=0.32.0,<0.33" "gradio>=5.0.0,<6" Pillow safetensors sentencepiece protobuf

COPY . /app

RUN useradd -m -u 1000 user && chown -R user /app
USER user

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