ash-171 commited on
Commit
d60424a
·
verified ·
1 Parent(s): 6ad39a0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -10
Dockerfile CHANGED
@@ -1,24 +1,23 @@
1
- FROM python:3.10-slim
2
-
3
  WORKDIR /app
4
 
5
  # Install system packages
6
  RUN apt-get update && apt-get install -y ffmpeg git wget && rm -rf /var/lib/apt/lists/*
7
 
8
- # Defined permission for pretrained_models
9
  ENV PYTHONUNBUFFERED=1
10
- RUN mkdir -p /app/pretrained_models && chmod -R 777 /app/pretrained_models
11
  ENV HOME=/app
12
-
13
- # Set cache envs (for Whisper + Hugging Face + SpeechBrain)
14
  ENV XDG_CACHE_HOME=/app/.cache
15
  ENV SPEECHBRAIN_CACHE=/app/.cache/speechbrain
16
 
17
- # Create cache dirs with write permission
18
- RUN mkdir -p /app/.cache/whisper /app/.cache/speechbrain && chmod -R 777 /app/.cache
 
 
 
19
 
20
  # Upgrade pip
21
- RUN pip install --no-cache-dir --upgrade pip
22
 
23
  # Copy source
24
  COPY . .
@@ -27,7 +26,7 @@ COPY . .
27
  RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
28
 
29
  # Install Python dependencies
30
- RUN pip install --no-cache-dir -r requirements.txt
31
 
32
  # Expose Streamlit port
33
  EXPOSE 8501
 
1
+ # Set working directory
 
2
  WORKDIR /app
3
 
4
  # Install system packages
5
  RUN apt-get update && apt-get install -y ffmpeg git wget && rm -rf /var/lib/apt/lists/*
6
 
7
+ # Set environment for proper model caching and permissions
8
  ENV PYTHONUNBUFFERED=1
 
9
  ENV HOME=/app
 
 
10
  ENV XDG_CACHE_HOME=/app/.cache
11
  ENV SPEECHBRAIN_CACHE=/app/.cache/speechbrain
12
 
13
+ # Create model/cache directories with correct permissions
14
+ RUN mkdir -p /app/pretrained_models \
15
+ && mkdir -p /app/wav2vec2_checkpoints \
16
+ && mkdir -p /app/.cache/whisper /app/.cache/speechbrain \
17
+ && chmod -R 777 /app/pretrained_models /app/wav2vec2_checkpoints /app/.cache
18
 
19
  # Upgrade pip
20
+ RUN pip install --no-cache-dir --upgrade pip --root-user-action=ignore
21
 
22
  # Copy source
23
  COPY . .
 
26
  RUN mkdir -p src && wget -O src/custome_interface.py https://huggingface.co/Jzuluaga/accent-id-commonaccent_xlsr-en-english/resolve/main/custom_interface.py
27
 
28
  # Install Python dependencies
29
+ RUN pip install --no-cache-dir -r requirements.txt --root-user-action=ignore
30
 
31
  # Expose Streamlit port
32
  EXPOSE 8501