File size: 603 Bytes
eb81d88
 
 
 
 
 
 
 
 
5bfbdaf
eb81d88
 
 
 
 
 
 
 
 
cccda5d
0d22b23
 
eb81d88
 
 
 
0d22b23
 
 
 
 
 
 
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
FROM python:3.10-slim

# Set up a non-root user (HF containers run as user ID 1000)
RUN useradd -m -u 1000 user
WORKDIR /home/user/app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

# Install Python packages
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy all your files
COPY . .


ENV HF_HOME=/home/user/.cache/huggingface

# Run as the HF user to avoid permission issues
USER user

# Start the FastAPI server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]