tranquilTrill commited on
Commit
39807ff
·
verified ·
1 Parent(s): c9d8b75

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies as root
4
+ RUN apt-get update && \
5
+ DEBIAN_FRONTEND=noninteractive apt-get install -y ffmpeg
6
+
7
+ # Create a non-root user
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV PATH="/home/user/.local/bin:$PATH"
11
+
12
+ WORKDIR /app
13
+
14
+ COPY --chown=user requirements.txt .
15
+ COPY --chown=user main.py .
16
+
17
+ RUN pip install --no-cache-dir -r requirements.txt torch torchaudio whisper
18
+ RUN python -c "import whisper; whisper.load_model('base')"
19
+
20
+ EXPOSE 7860
21
+
22
+ CMD ["python", "-u", "app.py"]