File size: 751 Bytes
ffe4cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official Python 3.9 image
FROM python:3.9-slim

# Set the working directory
WORKDIR /app
RUN mkdir -p /tmp/Ultralytics && chmod -R 777 /tmp/Ultralytics
ENV YOLO_CONFIG_DIR=/tmp/Ultralytics

# Install system dependencies
# We use libgl1 and libglib2.0-0 which are the modern equivalents
RUN apt-get update && apt-get install -y \

    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Copy the requirements file
COPY requirements.txt .

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

# Copy everything else
COPY . .

# Expose port 7860 for Hugging Face
EXPOSE 7860

# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]