File size: 659 Bytes
612105e
 
 
 
84d6a46
612105e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Start with Python 3.9
FROM python:3.9

# Install system libraries required for OpenCV
RUN apt-get update && apt-get install -y libgl1

# Set working directory
WORKDIR /code

# Copy requirements and install dependencies
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Create a writable directory for YOLO weights & temporary files
# Hugging Face runs as user 1000, so we must give permission
RUN mkdir -p /code/temp_files && chmod 777 /code/temp_files

# Copy the rest of the code
COPY . .

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