Files
Transcriptarr/Dockerfile.cpu
McCloudS c715f81241 Update Dockerfile.cpu
alpine doesn't have torch
2025-02-03 22:07:00 -07:00

36 lines
916 B
Docker

# === Stage 1: Build dependencies and install packages ===
FROM python:3.11-slim-bullseye AS builder
WORKDIR /subgen
# Install required build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
# === Stage 2: Create a minimal runtime image ===
FROM python:3.11-slim-bullseye AS runtime
WORKDIR /subgen
# Install only required runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy only necessary files from builder stage
COPY --from=builder /install /usr/local
# Copy source code
COPY launcher.py subgen.py language_code.py /subgen/
CMD ["python3", "launcher.py"]