File size: 899 Bytes
099d157
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 a lightweight python runtime built on Debian slim
FROM python:3.10-slim

# Install external OS level binaries required for OpenCV, Mediapipe, and Audio compilation
RUN apt-get update && apt-get install -y \

    ffmpeg \
    libsm6 \
    libxext6 \
    glib-2.0 \
    && rm -rf /var/lib/apt/lists/*

# Establish container path
WORKDIR /code

# Copy packages descriptor file first to cache layers
COPY ./backend/requirements.txt /code/requirements.txt

# Run pip upgrade installer 
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Bundle application sources together inside container paths
COPY ./backend /code/backend
COPY ./frontend /code/frontend

# Hugging Face Spaces exposes port 7860 natively
EXPOSE 7860

# Kick off your live Uvicorn microserver bound to port 7860
CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]