File size: 668 Bytes
42a9fc3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ca60ce9
 
42a9fc3
 
 
 
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
# HF Spaces docker runtime: builds this image and runs the container,
# expecting it to serve on the port declared as `app_port` in README.md.
FROM python:3.13-slim

WORKDIR /app

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

COPY . .

# Spaces containers run as a non-root user by convention; match that so
# huggingface_hub's cache writes (under $HOME/.cache) don't hit permission
# errors.
RUN useradd -m -u 1000 user
ENV HOME=/home/user
RUN chown -R user:user /app "$HOME"
USER user

ENV GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860 \
    PYTHONUNBUFFERED=1

EXPOSE 7860

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