-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (25 loc) · 936 Bytes
/
Dockerfile
File metadata and controls
33 lines (25 loc) · 936 Bytes
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
# 1. Use a lightweight Python base
FROM python:3.9-slim
# 2. Install FFmpeg (Crucial for Whisper) and Git
RUN apt-get update && apt-get install -y \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# 3. Set working directory
WORKDIR /app
# 4. Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 5. Copy the Application Code
COPY src/ ./src/
COPY app.py .
# 6. Create a non-root user and fix permissions
RUN useradd -m -u 1000 user
# This allows the app to create the 'temp' folder without Permission Denied errors
RUN chown -R user:user /app
# 7. Switch to the user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# 8. Run the app with security checks disabled for Hugging Face
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]