File size: 816 Bytes
2256a50
 
 
e5422eb
2256a50
 
 
 
 
 
 
 
 
09de49a
 
2256a50
09de49a
2256a50
 
 
 
 
 
 
09de49a
 
 
2256a50
 
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
30
FROM python:3.11-slim

# Install ffmpeg and other dependencies
RUN apt-get update && apt-get install -y ffmpeg curl nodejs gcc g++ git python3-tk && rm -rf /var/lib/apt/lists/*

# Set up a non-root user (Hugging Face requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# Copy backend requirements and install
COPY --chown=user backend/requirements.txt ./backend/
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r backend/requirements.txt

# Copy application code
COPY --chown=user . .

# Expose Hugging Face default port
EXPOSE 7860

# Change working directory to backend
WORKDIR $HOME/app/backend

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