File size: 815 Bytes
cb67677
 
04d442c
 
 
 
 
 
cb67677
 
 
 
 
 
 
 
 
3cc49a2
 
 
 
 
 
 
cb67677
 
 
 
 
 
 
 
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
FROM python:3.10-slim

# Install system dependencies for torchaudio and soundfile
RUN apt-get update && apt-get install -y \
    libsndfile1 \
    ffmpeg \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt .

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

# Create the Hugging Face cache directory and set permissions
RUN mkdir -p /tmp/hf_cache && chmod -R 777 /tmp/hf_cache

# Set environment variables for Hugging Face cache
ENV HOME=/root
ENV HF_HOME=/tmp/hf_cache

# Copy the rest of your app's code
COPY . .

# Expose the port that FastAPI will run on
EXPOSE 8000

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