File size: 632 Bytes
3d20cc5
 
b9ecc18
 
 
 
3d20cc5
b9ecc18
3d20cc5
 
 
 
 
 
 
b9ecc18
 
 
3d20cc5
b9ecc18
3d20cc5
 
b9ecc18
3d20cc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim

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

# Create a non-root user for Hugging Face (UID 1000)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# Copy your local files into the container
# This replaces the 'git clone' step and works with private code
COPY --chown=user . $HOME/app

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Run the FastAPI app using Uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]