Spaces:
Sleeping

File size: 634 Bytes
06f2ca4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.13-slim

# HF Spaces runs containers as UID 1000
RUN useradd -m -u 1000 user

WORKDIR /app

# Install dependencies (cached layer)
COPY requirements.txt .
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt

# Copy application source
COPY --chown=user:user . .

# Ensure the stats file location is writable at runtime
RUN mkdir -p storyscope/data && chown -R user:user storyscope/data

USER user

EXPOSE 7860

# TRUST_PROXY=true because HF Spaces sits behind a reverse proxy
ENV TRUST_PROXY=true
ENV PORT=7860

CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]