-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
58 lines (47 loc) · 1.78 KB
/
Copy pathDockerfile.gpu
File metadata and controls
58 lines (47 loc) · 1.78 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
55
56
57
58
# GPU-enabled Dockerfile для использования CUDA
# Использование: docker build -f Dockerfile.gpu -t insightaudio:gpu .
# Используем образ с cuDNN9 runtime (совместим с cu12)
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04
# Python 3.10
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
python3-pip \
ffmpeg \
git \
wget \
unzip \
build-essential \
gcc \
g++ \
libsndfile1 \
libgomp1 \
tesseract-ocr \
gosu \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/python3.10 /usr/bin/python
WORKDIR /app
# Copy only requirements first (better layer caching)
COPY requirements.txt .
# Install Python dependencies
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel \
&& pip3 install --no-cache-dir -r requirements.txt \
&& pip3 install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
# Workaround for this package
RUN pip3 install --no-cache-dir --no-build-isolation "nemo-toolkit[asr]==1.23.0"
# Prepare writable dirs for non-root user
RUN mkdir -p /app/logs /app/results /tmp/mplcache && \
mkdir -p /models /config && \
chown -R 1000:1000 /app /models /config /tmp
# Copy application code and default configs
COPY app/ ./app/
COPY config/default_settings.json ./config/default_settings.json
COPY config/prompt_templates.json ./config/prompt_templates.json
RUN cp ./config/default_settings.json ./config/config.json
# Create directories
RUN mkdir -p /models /config /tmp
EXPOSE 55667
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["python3", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "55667"]