diff --git a/stemengine.yml b/stemengine.yml new file mode 100644 index 0000000..67ff1a1 --- /dev/null +++ b/stemengine.yml @@ -0,0 +1,82 @@ +services: + stemengine: + container_name: stemengine + image: ghcr.io/seclusionenthusiast/stemengine:latest + runtime: nvidia + entrypoint: [] + restart: unless-stopped + networks: + - t2_proxy + security_opt: + - no-new-privileges:true + ports: + - "8000:8000" + volumes: + # Source code (live mount — changes reflect immediately via uvicorn --reload) + - ${SEFOLDER}/backend:/app/backend + - ${SEFOLDER}/lyrics-sync:/app/lyrics-sync + # Persistent storage for uploaded files and job outputs + - ${SEFOLDER}/jobs:/app/media/jobs + - ${SEFOLDER}/uploads:/app/media/uploads + - ${SEFOLDER}/imports:/app/media/imports + - ${SEFOLDER}/db:/app/media/db + # LRC sync data + - ${SEFOLDER}/lrc_sync:/app/media/lrc_sync + # Model caches (avoid re-downloading after container restart) + - ${SEFOLDER}/stemengine-models:/root/.cache + - ${SEFOLDER}/opt:/opt + # Frontend source — live mount so vite --watch picks up edits without a rebuild. + - ${SEFOLDER}/frontend:/app/frontend + # node_modules overlay: preserves the image-seeded packages; overlays the dir mount above. + - stemengine-node-modules:/app/frontend/node_modules + # Projects folder (where separated stems are stored) + - ${PROJECTS}:/app/media/projects + - ${SEFOLDER}/start.sh:/app/start.sh + command: /app/start.sh + environment: + - PUID=${PUID:-1000} + - PGID=${PGID:-1000} + - TZ=${TZ:-UTC} + # Root media directory — all path defaults derive from this. + - MEDIA_DIR=/app/media + # Storage layout (defaults shown — uncomment and change to override) + - UPLOAD_DIR=/app/media/uploads + - JOBS_DIR=/app/media/jobs + - PROJECTS_DIR=/app/media/projects + - DB_PATH=/app/media/db/stemengine.db + - LRC_SYNC_DIR=/app/media/lrc_sync + - BS_ROFORMER_MODEL_DIR=/opt/bs_roformer_models + - MEL_BAND_MODEL_DIR=/opt/mel_band_models + - MDXNET_MODEL_DIR=/opt/mdxnet_models + - SCNET_MODEL_DIR=/opt/scnet_models + - MEDLEYVOX_MODEL_DIR=/opt/medleyvox_models + - APOLLO_MODEL_DIR=/opt/apollo_models + - ASPIRATION_MODEL_DIR=/opt/aspiration_models + - BANDIT_MODEL_DIR=/opt/bandit_models + - CPU_SEPARATION=${CPU_SEPARATION:-false} + - MAX_UPLOAD_MB=${MAX_UPLOAD_MB:-500} + - PYTHONUNBUFFERED=1 + # Prevent CUDA OOM from allocator fragmentation when multiple large models + # (Demucs, BS-RoFormer, Whisper) are loaded in the same process. + - PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True + # Secret key for encrypting credentials at rest (required for Settings UI storage) + # Generate with: python3 -c "import secrets; print(secrets.token_hex(32))" + - SECRET_KEY=${SECRET_KEY} + # Subsonic server (optional — can also be set via the Settings UI) + - SUBSONIC_URL=${NAVSERVER} + - SUBSONIC_USERNAME=${NAVUSER} + - SUBSONIC_PASSWORD=${NAVPASS} + - HF_TOKEN=${HF_TOKEN} + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu] +volumes: + # Persists node_modules across container restarts; seeded from image on first start. + stemengine-node-modules: +networks: + t2_proxy: + external: true \ No newline at end of file