Fix portainer-stack.yml: add core/ and routes/ mounts, update for -2 container

This commit is contained in:
mARTin-B78 2026-05-29 14:53:00 +02:00
parent 00ffb52799
commit 28b1b73184
2 changed files with 31 additions and 18 deletions

View File

@ -9,6 +9,12 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
### Fixed ### Fixed
- **`No module named 'core'` on container restart** — `docker restart` reuses
the old container configuration and never applies new volume mounts from
`docker-compose.yml`. Added a comment to `portainer-stack.yml` and updated
it to include `core:/app/core:ro` and `routes:/app/routes:ro`. Solution is
`docker compose up -d` (recreates the container) not `docker restart`.
- **Text-input turns returned 422**`UploadFile | None = File(None)` with - **Text-input turns returned 422**`UploadFile | None = File(None)` with
`from __future__ import annotations` caused FastAPI to treat `audio` as a `from __future__ import annotations` caused FastAPI to treat `audio` as a
required field even when omitted. Changed to `Optional[UploadFile] = None` required field even when omitted. Changed to `Optional[UploadFile] = None`

View File

@ -1,37 +1,45 @@
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# TTS Voice Creator - Clone and Design — Portainer Stack # TTS Voice Creator - Clone and Design 2 — Portainer Stack
# #
# IMPORTANT: build the image on the host before deploying this stack: # IMPORTANT: build the image on the host before deploying / updating this stack:
# #
# docker build -t tts-voice-creator-clone-and-design:latest /home/sparky/Docker/tts-voice-creator-clone-and-design/ # cd /home/sparky/Docker/tts-voice-creator-clone-and-design-2
# docker build -t tts-voice-creator-clone-and-design-2:latest .
# #
# Then paste this file into Portainer → Stacks → Add stack → Web editor. # Then paste this file into Portainer → Stacks → Add stack → Web editor
# (or update the existing stack).
#
# After any Python code change (core/ or routes/) you must redeploy this stack
# or rebuild the image — a plain container restart is not enough.
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
services: services:
tts-voice-creator-clone-and-design: tts-voice-creator-clone-and-design-2:
image: tts-voice-creator-clone-and-design:latest image: tts-voice-creator-clone-and-design-2:latest
container_name: tts-voice-creator-clone-and-design container_name: tts-voice-creator-clone-and-design-2
restart: unless-stopped restart: unless-stopped
ports: ports:
- "7860:7860" - "7890:7890"
volumes:
- /home/sparky/Projekte/TTS_Voices:/voices:rw
- tts-voice-creator-clone-and-design:/home/app/.config/voice-clone-factory
- /home/sparky/Docker/tts-voice-creator-clone-and-design/static:/app/static:ro
- /var/run/docker.sock:/var/run/docker.sock
group_add: group_add:
- "988" - "988"
volumes:
- /home/sparky/Projekte/TTS_Voices:/voices:rw
- tts-voice-creator-clone-and-design-2:/home/app/.config/tts-voice-creator
- /var/run/docker.sock:/var/run/docker.sock:ro
# ── Hot-reload mounts (changes apply on container recreate, not restart) ──
- /home/sparky/Docker/tts-voice-creator-clone-and-design-2/server.py:/app/server.py:ro
- /home/sparky/Docker/tts-voice-creator-clone-and-design-2/core:/app/core:ro
- /home/sparky/Docker/tts-voice-creator-clone-and-design-2/routes:/app/routes:ro
- /home/sparky/Docker/tts-voice-creator-clone-and-design-2/static:/app/static:ro
environment: environment:
- PYTHONUNBUFFERED=1 - PYTHONUNBUFFERED=1
- VOICES_DIR=/voices - VOICES_DIR=/voices
- OUTPUT_DIR=/voices/active_voices - OUTPUT_DIR=/voices/active_voices
- TTS_CONTAINER_NAME=faster-qwen3-tts-voiceclone - TTS_CONTAINER_NAMES=faster-qwen3-tts-voiceclone,faster-qwen3-tts-streaming
- TTS_STREAM_URL=http://host.docker.internal:8023
- VOICE_DESIGN_MODEL=Qwen3-TTS-12Hz-1.7B-VoiceDesign - VOICE_DESIGN_MODEL=Qwen3-TTS-12Hz-1.7B-VoiceDesign
extra_hosts: extra_hosts:
@ -40,9 +48,8 @@ services:
networks: networks:
- dgx_net - dgx_net
volumes: volumes:
tts-voice-creator-clone-and-design: tts-voice-creator-clone-and-design-2:
networks: networks:
dgx_net: dgx_net: