File size: 1,015 Bytes
cf280fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ed5bb1e
f40ee09
 
ed5bb1e
f40ee09
 
ed5bb1e
f40ee09
 
ed5bb1e
f40ee09
cf280fd
ed5bb1e
f40ee09
ed5bb1e
f40ee09
 
ed5bb1e
4d11038
ed5bb1e
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
34
35
36
37
38
39
40
41
42
43
44
45
46
# # Use a slim Python 3.10 base image
# FROM python:3.10-slim

# # Set working directory
# WORKDIR /app

# # Copy all code and files into the container
# COPY . .

# # Upgrade pip and install dependencies
# RUN pip install --upgrade pip
# RUN pip install --no-cache-dir -r requirements.txt

# # Optional: expose port (HF injects this automatically)
# EXPOSE 7860

# ENV PORT = 7860

# # Start the FastAPI app on the HF assigned port
# # CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]

# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]



# Use slim Python image
FROM python:3.10-slim

# Set workdir
WORKDIR /app

# Copy all files
COPY . .

# Upgrade pip and install requirements
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN apt-get update && apt-get install -y ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*

# Expose HF Spaces port
EXPOSE 7860

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