File size: 726 Bytes
2318eae
 
 
 
 
 
 
 
 
 
 
 
0586d3c
 
 
 
 
 
2318eae
 
 
 
 
 
 
 
 
 
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
# Hugging Face Spaces: FastAPI + ASR (CPU-only)
FROM python:3.10-slim

# Install system deps
RUN apt-get update && apt-get install -y \
    ffmpeg libsndfile1 git curl build-essential && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /code

# Copy code
COPY ./app /code/app

# Create hf_cache and make it world-writable so the non-root runtime user can use it
RUN mkdir -p /code/app/hf_cache \
  && chmod -R a+rwX /code/app/hf_cache

# Copy and install Python dependencies
COPY requirements.txt ./

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

# Expose default port for HF Spaces
EXPOSE 7860

# Entrypoint for FastAPI app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]