File size: 668 Bytes
d6d410e
 
fb9600d
d6d410e
fb9600d
 
d6d410e
 
fb9600d
d6d410e
 
 
 
 
fb9600d
d6d410e
 
 
 
 
c2a07d1
fb9600d
d6d410e
ffabdb7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use official Python slim image
FROM python:3.9-slim

# Set working directory inside the container
WORKDIR /app

# Copy all files from current directory to /app in the container
COPY . /app

# Install system dependencies for PIL and PyTorch
RUN apt-get update && apt-get install -y \
    gcc \
    libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip and install python dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt

# Expose the port your FastAPI app will run on (7860 is standard on Hugging Face Spaces)
EXPOSE 7860

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