WebashalarForML commited on
Commit
7b8f950
·
verified ·
1 Parent(s): ad480d5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +48 -23
Dockerfile CHANGED
@@ -12,30 +12,55 @@ WORKDIR /app
12
  # Copy the requirements file into the container at /app
13
  COPY requirements.txt /app/
14
 
15
- # Install build dependencies
16
- RUN apt-get update && \
17
- apt-get install -y --no-install-recommends \
18
- llvm \
19
- clang \
20
- build-essential \
21
- libedit-dev \
22
- libffi-dev \
23
- python3-dev \
24
- libgl1-mesa-glx \
25
- libsm6 \
26
- libxrender1 \
27
- libglib2.0-0 \
28
- ffmpeg \
29
- libsndfile1 \
30
- libsndfile1-dev \
31
- && rm -rf /var/lib/apt/lists/*
32
-
33
- # Set LLVM_CONFIG before building llvmlite (if needed)
34
- # For numba 0.48.0 and llvmlite 0.31.0, often llvm-config-8 or llvm-config-9 is relevant.
35
- # Python 3.9 is newer, so you might need to ensure a compatible LLVM is installed.
36
- # Let's try to be specific for older LLVM needed by llvmlite 0.31.0
37
- RUN apt-get update && apt-get install -y llvm-9-dev && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  ENV LLVM_CONFIG=/usr/bin/llvm-config-9
 
 
39
 
40
  # Explicitly install compatible versions of core audio/Numba stack
41
  # Order matters: numpy -> llvmlite -> numba -> resampy -> librosa
 
12
  # Copy the requirements file into the container at /app
13
  COPY requirements.txt /app/
14
 
15
+ # --- START LLVM INSTALLATION FIX ---
16
+ # Add Debian's oldstable repository to ensure access to llvm-9-dev if it's considered "older"
17
+ # for the default slim image's sources.
18
+ # This ensures we can find packages that might not be in the primary/current stable sources.
19
+ # It's important to use the correct release name for oldstable (e.g., bullseye, buster).
20
+ # For Python 3.9-slim (Debian 11 Bullseye), bullseye is the current stable, so llvm-9-dev should be there.
21
+ # Let's ensure the regular apt sources are exhaustive.
22
+
23
+ RUN apt-get update && apt-get install -y --no-install-recommends \
24
+ lsb-release \
25
+ wget \
26
+ gnupg2 \
27
+ software-properties-common \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ # Add LLVM's official APT repository for a wider range of LLVM versions
31
+ # This is generally more reliable for specific LLVM versions.
32
+ RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
33
+ RUN echo "deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-9 main" >> /etc/apt/sources.list.d/llvm.list \
34
+ && echo "deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-9 main" >> /etc/apt/sources.list.d/llvm.list
35
+
36
+ # Update apt cache again to include the new LLVM repository
37
+ RUN apt-get update
38
+
39
+ # Install specific LLVM 9 development packages
40
+ RUN apt-get install -y --no-install-recommends \
41
+ llvm-9-dev \
42
+ llvm-9 \
43
+ llvm-9-runtime \
44
+ clang-9 \
45
+ # Ensure standard build tools and audio libs are present
46
+ build-essential \
47
+ libedit-dev \
48
+ libffi-dev \
49
+ python3-dev \
50
+ libgl1-mesa-glx \
51
+ libsm6 \
52
+ libxrender1 \
53
+ libglib2.0-0 \
54
+ ffmpeg \
55
+ libsndfile1 \
56
+ libsndfile1-dev \
57
+ && rm -rf /var/lib/apt/lists/*
58
+
59
+ # Set LLVM_CONFIG to the specific version's config script
60
+ # This is crucial for llvmlite to find the correct LLVM installation
61
  ENV LLVM_CONFIG=/usr/bin/llvm-config-9
62
+ # --- END LLVM INSTALLATION FIX ---
63
+
64
 
65
  # Explicitly install compatible versions of core audio/Numba stack
66
  # Order matters: numpy -> llvmlite -> numba -> resampy -> librosa