File size: 727 Bytes
8fc590e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.12-slim

# Install system essential dependencies for building C/C++ packages
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /code

# Copy requirements and install pre-built wheel index for superfast CPU performance
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r /code/requirements.txt

# Copy all application files to the container workspace
COPY . .

# Expose port 7860 which is standard for Hugging Face Spaces
EXPOSE 7860

# Command to run FastAPI server on 0.0.0.0
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]