Yoonc commited on
Commit
26e3b5e
·
verified ·
1 Parent(s): d787796

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -12
Dockerfile CHANGED
@@ -3,13 +3,11 @@
3
  # Streamlit + PyAudio + Whisper
4
  # ================================
5
 
6
- # Use an official Python base image
7
  FROM python:3.13.7
8
 
9
- # Set working directory
10
  WORKDIR /app
11
 
12
- # Install system dependencies for PyAudio, PortAudio, and audio handling
13
  RUN apt-get update && apt-get install -y \
14
  build-essential \
15
  portaudio19-dev \
@@ -17,7 +15,7 @@ RUN apt-get update && apt-get install -y \
17
  libsndfile1 \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- # Copy application files
21
  COPY . /app
22
 
23
  # Install Python dependencies
@@ -31,19 +29,21 @@ RUN pip install --no-cache-dir \
31
  plotly \
32
  pandas
33
 
34
- # (Optional) expose Streamlit’s default port
35
- EXPOSE 7860
36
-
37
- # Set environment variable for Streamlit
38
  ENV STREAMLIT_SERVER_PORT=7860
39
  ENV STREAMLIT_SERVER_ENABLECORS=false
40
  ENV STREAMLIT_SERVER_HEADLESS=true
41
 
42
-
43
- ENV TRANSFORMERS_CACHE=/app/cache
44
  ENV HF_HOME=/app/cache
45
- RUN mkdir -p /app/cache
 
 
 
46
 
 
 
47
 
48
- # Start the Streamlit app
49
  CMD ["streamlit", "run", "main.py"]
 
3
  # Streamlit + PyAudio + Whisper
4
  # ================================
5
 
 
6
  FROM python:3.13.7
7
 
 
8
  WORKDIR /app
9
 
10
+ # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
12
  build-essential \
13
  portaudio19-dev \
 
15
  libsndfile1 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Copy all app files
19
  COPY . /app
20
 
21
  # Install Python dependencies
 
29
  plotly \
30
  pandas
31
 
32
+ # Set environment variables
 
 
 
33
  ENV STREAMLIT_SERVER_PORT=7860
34
  ENV STREAMLIT_SERVER_ENABLECORS=false
35
  ENV STREAMLIT_SERVER_HEADLESS=true
36
 
37
+ # Create and set writable cache directories
38
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
39
  ENV HF_HOME=/app/cache
40
+ ENV TRANSFORMERS_CACHE=/app/cache
41
+
42
+ # (Optional but helpful for Hugging Face Spaces)
43
+ ENV XDG_CACHE_HOME=/app/cache
44
 
45
+ # Expose Streamlit’s default port
46
+ EXPOSE 7860
47
 
48
+ # Run the app
49
  CMD ["streamlit", "run", "main.py"]