File size: 917 Bytes
4e0c3d9
 
 
62ec371
 
 
 
ada6fd8
62ec371
 
4e0c3d9
 
 
 
62ec371
4e0c3d9
 
62ec371
4e0c3d9
62ec371
 
4e0c3d9
 
62ec371
 
 
6971ed7
 
62ec371
6971ed7
62ec371
4e0c3d9
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
33
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

# Use a stable and available Python version
FROM python:3.11

# 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 files from the build context to the container
COPY --chown=user . /app

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

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