-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 1.17 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (31 loc) · 1.17 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
FROM python:3.11-slim
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install Piper TTS binary
ARG PIPER_VERSION=2023.11.14-2
ARG TARGETARCH
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) PIPER_ARCH="x86_64" ;; \
arm64) PIPER_ARCH="aarch64" ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}"; exit 1 ;; \
esac; \
wget -q "https://github.com/rhasspy/piper/releases/download/${PIPER_VERSION}/piper_linux_${PIPER_ARCH}.tar.gz" -O /tmp/piper.tar.gz; \
tar -xzf /tmp/piper.tar.gz -C /usr/local/bin --strip-components=1; \
rm /tmp/piper.tar.gz
WORKDIR /app
COPY requirements.txt requirements-bench.txt ./
ARG INSTALL_BENCHMARK_DEPS=false
RUN set -eux; \
pip install --no-cache-dir -r requirements.txt; \
if [ "${INSTALL_BENCHMARK_DEPS}" = "true" ]; then \
pip install --no-cache-dir -r requirements-bench.txt; \
fi
COPY . .
# Directory for downloaded Piper voice models
RUN mkdir -p models
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]