File size: 760 Bytes
8f376e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86056a1
 
 
 
 
8f376e0
 
 
 
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
FROM python:3.11-slim

# CPU-only PyTorch keeps the image small
RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu

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

# Non-root user (Hugging Face Spaces convention)
RUN useradd -m -u 1000 user
USER user
WORKDIR /home/user/app

COPY --chown=user . /home/user/app

# Gallery assets ship as one LFS tar (same channel as the model weights,
# which is known to survive the build) — unpack to the paths the app expects.
RUN tar -xf static_assets.tar -C static && rm static_assets.tar \
    && echo "static tree after unpack:" && find static -name '*.jpg' | wc -l

ENV PORT=7860
EXPOSE 7860

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