sidmazak commited on
Commit
f8353c2
·
verified ·
1 Parent(s): 2f93c82

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -5
Dockerfile CHANGED
@@ -1,13 +1,13 @@
1
  # Dockerfile
2
  FROM python:3.10-slim-bookworm AS builder
3
 
4
- # Install system dependencies (execstack is available in Bookworm)
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  gcc \
7
  g++ \
8
  ffmpeg \
9
  libsndfile1 \
10
- execstack \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  WORKDIR /app
@@ -19,14 +19,14 @@ COPY requirements.txt .
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
22
- # Clear the executable stack flag on ctranslate2 shared libraries
23
  # This resolves the "cannot enable executable stack" error at import time
24
- RUN find /usr/local/lib -name "libctranslate2*.so*" -exec execstack -c {} \; || true
25
 
26
  # Final stage
27
  FROM python:3.10-slim-bookworm
28
 
29
- # Install runtime system dependencies (ffmpeg required for audio conversion)
30
  RUN apt-get update && apt-get install -y --no-install-recommends \
31
  ffmpeg \
32
  libsndfile1 \
 
1
  # Dockerfile
2
  FROM python:3.10-slim-bookworm AS builder
3
 
4
+ # Install system dependencies, including patchelf (available in default repos)
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  gcc \
7
  g++ \
8
  ffmpeg \
9
  libsndfile1 \
10
+ patchelf \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  WORKDIR /app
 
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
  pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Clear the executable stack flag on ctranslate2 shared libraries using patchelf
23
  # This resolves the "cannot enable executable stack" error at import time
24
+ RUN find /usr/local/lib -name "libctranslate2*.so*" -exec patchelf --clear-execstack {} \; || true
25
 
26
  # Final stage
27
  FROM python:3.10-slim-bookworm
28
 
29
+ # Install runtime system dependencies
30
  RUN apt-get update && apt-get install -y --no-install-recommends \
31
  ffmpeg \
32
  libsndfile1 \