Update Dockerfile
Browse files- Dockerfile +5 -19
Dockerfile
CHANGED
@@ -4,31 +4,16 @@ FROM python:3.12.2
|
|
4 |
# Add a new user but do not switch yet
|
5 |
RUN useradd -m -u 1000 user
|
6 |
|
7 |
-
# Set non-interactive mode for package installation
|
8 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
9 |
-
ENV TZ=UTC
|
10 |
-
|
11 |
-
# Install system dependencies (RUN as root)
|
12 |
-
RUN apt-get update && apt-get install -y \
|
13 |
-
ffmpeg \
|
14 |
-
git \
|
15 |
-
curl \
|
16 |
-
build-essential \
|
17 |
-
cargo \
|
18 |
-
pkg-config \
|
19 |
-
libssl-dev \
|
20 |
-
&& rm -rf /var/lib/apt/lists/*
|
21 |
-
|
22 |
-
# Switch to non-root user AFTER installing system dependencies
|
23 |
-
USER user
|
24 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
25 |
-
|
26 |
# Set working directory
|
27 |
WORKDIR /app
|
28 |
|
29 |
# Copy application code with correct ownership
|
30 |
COPY --chown=user . /app/
|
|
|
31 |
|
|
|
|
|
|
|
32 |
|
33 |
# Install Python dependencies
|
34 |
RUN pip install --no-cache-dir -U pip setuptools wheel
|
@@ -36,6 +21,7 @@ RUN pip install --no-cache-dir setuptools-rust
|
|
36 |
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
37 |
RUN pip install --no-cache-dir -r requirements.txt
|
38 |
|
|
|
39 |
# Environment variables for PyTorch and Whisper
|
40 |
ENV TORCH_DEVICE="cuda"
|
41 |
ENV FORCE_FP32="false"
|
|
|
4 |
# Add a new user but do not switch yet
|
5 |
RUN useradd -m -u 1000 user
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Set working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
# Copy application code with correct ownership
|
11 |
COPY --chown=user . /app/
|
12 |
+
USER root
|
13 |
|
14 |
+
RUN apt-get update && apt-get install git -y
|
15 |
+
RUN pip3 install "git+https://github.com/openai/whisper.git"
|
16 |
+
RUN apt-get update && apt-get install -y ffmpeg
|
17 |
|
18 |
# Install Python dependencies
|
19 |
RUN pip install --no-cache-dir -U pip setuptools wheel
|
|
|
21 |
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
|
24 |
+
|
25 |
# Environment variables for PyTorch and Whisper
|
26 |
ENV TORCH_DEVICE="cuda"
|
27 |
ENV FORCE_FP32="false"
|