File size: 984 Bytes
8ccb3e9
 
 
 
 
 
 
 
 
 
0b268cb
8ccb3e9
 
 
 
 
 
 
 
 
 
 
 
 
72b3151
 
 
 
 
 
 
 
 
 
 
8ccb3e9
 
 
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
31
32
33
34
35
36
37
38
39
FROM pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime

ENV DEBIAN_FRONTEND=noninteractive \
    PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PIP_NO_CACHE_DIR=1 \
    HF_HOME=/root/.cache/huggingface

RUN apt-get update \
    && apt-get install --yes --no-install-recommends \
        build-essential \
        git \
        libgl1 \
        libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN python -m pip install --upgrade pip \
    && python -m pip install -r requirements.txt

COPY . .

RUN if grep -RIl \
        --include='*.png' \
        --include='*.jpg' \
        --include='*.jpeg' \
        --include='*.gif' \
        --include='*.webp' \
        'version https://git-lfs.github.com/spec/v1' static | grep -q .; then \
        echo >&2 "ERROR: Git LFS image assets are missing. Run 'git lfs pull' before building."; \
        exit 1; \
    fi

EXPOSE 7860

CMD ["python", "app.py", "--host", "0.0.0.0", "--port", "7860"]