drrobot9 commited on
Commit
95070fc
·
verified ·
1 Parent(s): a988a6f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,18 +1,35 @@
1
  # Base image
2
  FROM python:3.12-slim
3
 
 
 
 
4
  # Set workdir
5
  WORKDIR /app
6
 
7
- # Copy code and config
 
 
 
 
 
 
 
8
  COPY . .
9
 
10
- # Install dependencies
11
  RUN pip install --no-cache-dir \
12
- torch torchaudio librosa soundfile requests transformers fastapi uvicorn[standard] python-multipart
 
 
 
 
 
 
 
13
 
14
  # Expose port
15
  EXPOSE 7860
16
 
17
- # Run FastAPI
18
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Base image
2
  FROM python:3.12-slim
3
 
4
+ # Prevent prompts
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
  # Set workdir
8
  WORKDIR /app
9
 
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ ffmpeg \
13
+ git \
14
+ build-essential \
15
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Copy everything
18
  COPY . .
19
 
20
+ # Install Python dependencies
21
  RUN pip install --no-cache-dir \
22
+ torch \
23
+ torchaudio \
24
+ requests \
25
+ transformers \
26
+ fastapi \
27
+ uvicorn[standard] \
28
+ python-multipart \
29
+ starlette
30
 
31
  # Expose port
32
  EXPOSE 7860
33
 
34
+ # Start API server
35
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]