-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (50 loc) Β· 2.29 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (50 loc) Β· 2.29 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
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
# ββ Environment βββββββββββββββββββββββββββββ
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV OMNIVOICE_MODEL_PATH=/app/model
ENV OMNIVOICE_MODEL_DIR=/app/model
ENV OMNIVOICE_PORT=7860
ENV OMNIVOICE_HOST=0.0.0.0
# ββ System packages βββββββββββββββββββββββββ
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
libffi-dev \
liblzma-dev \
libgl1-mesa-glx \
libglib2.0-0 \
curl \
git \
wget \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# ββ Python 3.12 βββββββββββββββββββββββββββββ
RUN add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends python3.12 python3.12-dev python3.12-venv \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
# ββ Copy installer + server βββββββββββββββββ
WORKDIR /app
COPY install.sh /app/install.sh
COPY server.py /app/server.py
# ββ Run installer in Docker mode ββββββββββββ
# 1) pip install torch + omnivoice + fastapi + ...
# 2) hf download hotdogs/omnivoice-thai β /app/model (~4.4GB)
# 3) skip system checks, skip server start
RUN chmod +x /app/install.sh /app/server.py \
&& bash /app/install.sh --docker
# ββ Expose ββββββββββββββββββββββββββββββββββ
EXPOSE 7860
# ββ Health check ββββββββββββββββββββββββββββ
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -fsS http://localhost:7860/api/health || exit 1
# ββ Run βββββββββββββββββββββββββββββββββββββ
CMD ["python3", "server.py"]