-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 882 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (27 loc) · 882 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
34
35
# Use slim Python image
FROM python:3.10-slim
# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# System deps for librosa/soundfile/matplotlib and audio
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ffmpeg \
libsndfile1 \
libgl1 \
libsm6 \
libxext6 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy only requirements first for better caching
COPY requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py ./
COPY src ./src
# Streamlit config for Spaces (expects port 7860)
ENV STREAMLIT_SERVER_PORT=7860 \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
EXPOSE 7860
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]