File size: 918 Bytes
eb1b896
 
 
608e7b2
2e6e4ce
608e7b2
3cd4852
0d53786
608e7b2
 
eb1b896
 
 
 
608e7b2
eb1b896
 
608e7b2
eb1b896
608e7b2
 
eb1b896
 
608e7b2
eb1b896
608e7b2
 
 
 
 
 
eb1b896
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
31
32
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

# Use Python 3.11 as the base image
FROM python:3.12

# Install FFmpeg
RUN apt-get update && apt-get install -y ffmpeg

# Create a non - root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory
WORKDIR /app

# Copy the requirements file
COPY --chown=user ./requirements.txt requirements.txt

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

# Copy all other files to the working directory
COPY --chown=user . /app

# Set appropriate permissions for all files and directories in the app
RUN find /app -type f -exec chmod 644 {} \; && \
    find /app -type d -exec chmod 755 {} \;

# Start the application using Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]