Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (43 loc) · 3.16 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (43 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# ── Base image ─────────────────────────────────────────────────────────────
# nvidia/cuda base for GPU access by WhisperX
FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# ── System deps ────────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 \
python3.11-venv \
python3-pip \
ffmpeg \
nginx \
supervisor \
curl \
&& rm -rf /var/lib/apt/lists/*
# Make python3.11 the default python3
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
# ── Install WhisperX ───────────────────────────────────────────────────────
# WhisperX requires torch; install CPU-only torch first to avoid pulling in
# the huge CUDA torch wheel (the CUDA runtime is already on the base image).
# Users who need GPU-accelerated WhisperX can switch to the CUDA torch wheel.
RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir whisperx
# ── App dependencies ───────────────────────────────────────────────────────
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ── Copy application ───────────────────────────────────────────────────────
COPY . .
# Create storage directories (will be volume-mounted in production)
RUN mkdir -p storage/tmp
# ── nginx config ───────────────────────────────────────────────────────────
COPY nginx/nginx.conf /etc/nginx/nginx.conf
# Remove default nginx site
RUN rm -f /etc/nginx/sites-enabled/default
# ── supervisord config ─────────────────────────────────────────────────────
COPY supervisord.conf /etc/supervisor/conf.d/transcriber.conf
# ── Ports ──────────────────────────────────────────────────────────────────
EXPOSE 80
# ── Entrypoint ─────────────────────────────────────────────────────────────
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]