60b86be706
check-rebuild-needed.sh war seit Mai funktionsfähig nur fuer 3 von 10
Containern. Die anderen 7 Dockerfiles hatten kein ARG/ENV BUILD_SHA und
docker-compose.yml hat fuer KEINEN Service den Wert durchgereicht — daher
defaultete BUILD_SHA ueberall auf "unknown" und die Drift-Check war
zahnlos.
- ARG BUILD_SHA + ENV BUILD_SHA in 8 zusaetzlichen Dockerfiles
(ai-compliance-sdk, developer-portal, document-crawler, dsms-gateway,
compliance-tts-service, docs-src, docs-site, dsms-node)
- docker-compose.yml: BUILD_SHA: \${BUILD_SHA:-unknown} in jedem build:
Block (10 Services)
- .gitea/workflows/ci.yaml: neuer Job build-sha-integrity validiert dass
jedes Dockerfile ARG+ENV hat und jeder compose-build den Arg durchreicht.
Faellt bei jedem PR/Push gegen master, der einen neuen Service oder
Dockerfile ohne BUILD_SHA einfuehrt.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
2.1 KiB
Docker
46 lines
2.1 KiB
Docker
FROM python:3.12-slim
|
|
|
|
# System dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg libsndfile1 imagemagick fonts-dejavu-core wget curl && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Piper binary (pre-built for aarch64)
|
|
RUN mkdir -p /opt/piper && ARCH=$(dpkg --print-architecture) && if [ "$ARCH" = "arm64" ]; then PIPER_ARCH="aarch64"; else PIPER_ARCH="x86_64"; fi && wget -q -O /tmp/piper.tar.gz "https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_${PIPER_ARCH}.tar.gz" && tar -xzf /tmp/piper.tar.gz -C /opt/ && rm /tmp/piper.tar.gz && ln -s /opt/piper/piper /usr/local/bin/piper
|
|
|
|
# Create non-root user
|
|
RUN useradd -m -u 1000 ttsuser
|
|
|
|
WORKDIR /app
|
|
|
|
# Python dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Download Piper voice models
|
|
RUN mkdir -p /app/models && \
|
|
wget -q -O /app/models/de_DE-thorsten-high.onnx \
|
|
"https://huggingface.co/rhasspy/piper-voices/resolve/main/de/de_DE/thorsten/high/de_DE-thorsten-high.onnx" && \
|
|
wget -q -O /app/models/de_DE-thorsten-high.onnx.json \
|
|
"https://huggingface.co/rhasspy/piper-voices/resolve/main/de/de_DE/thorsten/high/de_DE-thorsten-high.onnx.json" && \
|
|
wget -q -O /app/models/en_US-lessac-high.onnx \
|
|
"https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/high/en_US-lessac-high.onnx" && \
|
|
wget -q -O /app/models/en_US-lessac-high.onnx.json \
|
|
"https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/lessac/high/en_US-lessac-high.onnx.json"
|
|
|
|
# Copy application
|
|
COPY . .
|
|
|
|
# Fix ImageMagick policy for text rendering
|
|
RUN if [ -f /etc/ImageMagick-6/policy.xml ]; then sed -i "s/rights=\"none\" pattern=\"PDF\"/rights=\"read|write\" pattern=\"PDF\"/" /etc/ImageMagick-6/policy.xml; fi
|
|
|
|
RUN chown -R ttsuser:ttsuser /app
|
|
USER ttsuser
|
|
|
|
ARG BUILD_SHA="unknown"
|
|
ENV BUILD_SHA=${BUILD_SHA}
|
|
|
|
EXPOSE 8095
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 CMD curl -sf http://127.0.0.1:8095/health || exit 1
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8095"]
|