From ed1e51fefa0e9973aafcffc9d080ab84729c22ff Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Thu, 8 Aug 2024 17:24:48 +0800 Subject: [PATCH] add docker --- Dockerfile | 19 +++++++++++++++++++ start-docker.sh | 10 ++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100755 start-docker.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..49c1b24 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM docker.io/nvidia/cuda:12.0.0-cudnn8-runtime-ubuntu22.04 + +RUN apt-get update && \ + apt-get install -y ffmpeg python3 python3-pip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY requirements.txt . + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 5000 + +# 启动 whisper_fastapi.py +ENTRYPOINT ["python3", "whisper_fastapi.py"] diff --git a/start-docker.sh b/start-docker.sh new file mode 100755 index 0000000..dee552a --- /dev/null +++ b/start-docker.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +docker run -d --name whisper-fastapi \ + --restart unless-stopped \ + --name whisper-fastapi \ + -v ~/.cache/huggingface:/root/.cache/huggingface \ + --gpus all \ + -p 5000:5000 \ + docker.io/heimoshuiyu/whisper-fastapi:lastet \ + --model large-v2 \ No newline at end of file