Keeby-smilyai commited on
Commit
3a7aa5f
·
verified ·
1 Parent(s): e17f481

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -15
Dockerfile CHANGED
@@ -1,26 +1,34 @@
1
- # Use Python 3.11 slim instead of 3.13
2
  FROM python:3.11-slim
3
 
4
- WORKDIR /app
5
-
6
- RUN apt-get update && apt-get install -y \
7
- build-essential \
8
- curl \
9
- git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy requirements and source code
13
- COPY requirements.txt ./
14
- COPY src/ ./src/
15
 
16
- # Upgrade pip, setuptools, wheel
17
- RUN pip3 install --upgrade pip setuptools wheel
18
 
19
  # Install Python dependencies
20
- RUN pip3 install -r requirements.txt
 
 
 
 
 
 
 
 
 
21
 
 
22
  EXPOSE 8501
23
 
24
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
25
 
26
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
1
  FROM python:3.11-slim
2
 
3
+ # Install system dependencies for audio processing
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ libsndfile1 \
6
+ ffmpeg \
 
 
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # Set working directory
10
+ WORKDIR /app
 
11
 
12
+ # Copy app files
13
+ COPY . /app
14
 
15
  # Install Python dependencies
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Disable Streamlit usage stats to avoid permission issues with ~/.streamlit
19
+ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=0
20
+
21
+ # Set HOME to avoid root directory writes
22
+ ENV HOME=/root
23
+
24
+ # Create .streamlit dir if needed (though env var should suffice)
25
+ RUN mkdir -p /root/.streamlit
26
 
27
+ # Expose Streamlit port
28
  EXPOSE 8501
29
 
30
+ # Health check
31
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
32
 
33
+ # Run the app
34
+ CMD ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]