From cfab2a500a91b9fe302965557bbe93041212b774 Mon Sep 17 00:00:00 2001 From: debpalash Date: Sun, 3 May 2026 09:04:49 +0530 Subject: [PATCH] feat: add GHCR Docker workflow, update README with container registry instructions - New .github/workflows/docker.yml publishes images to ghcr.io on tag push - README Docker section now leads with 'docker pull' from GHCR - docker-compose.yml defaults to GHCR image with build-from-source fallback - Dockerfile: copy README.md for hatchling metadata resolution --- .github/workflows/docker.yml | 68 ++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++ README.md | 42 +++++++++++++++++++--- deploy/Dockerfile | 4 +-- deploy/docker-compose.yml | 16 +++++---- uv.lock | 2 +- 6 files changed, 122 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..3aab64d5 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,68 @@ +# Publish Docker images to GitHub Container Registry (GHCR). +# +# Triggers: +# - push of a tag matching `v*` (e.g. `v0.2.7`) → pushed as :0.2.7 + :latest +# - workflow_dispatch → pushed as :sha- (for testing) +# +# Images land at: ghcr.io/debpalash/omnivoice-studio + +name: Docker (GHCR) + +on: + push: + tags: ['v*'] + workflow_dispatch: + +permissions: + contents: read + packages: write + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + build-and-push: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + # QEMU enables cross-platform builds (arm64 on x64 runner). + # Skipped for now — only building linux/amd64. + # - uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extracts semver tags from the git ref: + # v0.2.7 → 0.2.7, latest + # manual dispatch → sha-abc1234 + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha,prefix=sha-,format=short + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: deploy/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.gitignore b/.gitignore index d4ea0cda..ee476c3b 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,6 @@ frontend/src-tauri/binaries/ffmpeg # cuDNN 8 compat libs (auto-installed by scripts/setup_cudnn.py) cudnn8_compat/ test-results/ + +# Research repos (local only) +research/ diff --git a/README.md b/README.md index 6ef1e0c8..b44d87f7 100644 --- a/README.md +++ b/README.md @@ -115,17 +115,51 @@ That's it. Open [localhost:3901](http://localhost:3901) and start cloning voices ### Docker +Pull the pre-built image from **GitHub Container Registry** — no build step needed: + +```bash +docker pull ghcr.io/debpalash/omnivoice-studio:latest +``` + +Run it: + ```bash # CPU mode -docker compose up --build -d +docker run -d --name omnivoice \ + -p 127.0.0.1:3900:3900 \ + -v omnivoice-data:/app/omnivoice_data \ + ghcr.io/debpalash/omnivoice-studio:latest -# Or with NVIDIA GPU -docker compose --profile gpu up --build -d +# NVIDIA GPU mode +docker run -d --name omnivoice --gpus all \ + -p 127.0.0.1:3900:3900 \ + -v omnivoice-data:/app/omnivoice_data \ + ghcr.io/debpalash/omnivoice-studio:latest +``` + +Or use **Docker Compose** with the GHCR image: + +```bash +# CPU mode +docker compose -f deploy/docker-compose.yml up -d + +# GPU mode +docker compose -f deploy/docker-compose.yml --profile gpu up -d ``` Open [http://localhost:3900](http://localhost:3900) once the health check passes. First run downloads ~4 GB of model weights — progress is shown in `docker compose logs -f`. -> **Network access:** the container binds to `127.0.0.1` only. To reach OmniVoice from another machine on your LAN, change the port mapping in `docker-compose.yml` to `"0.0.0.0:3900:3900"`. OmniVoice ships no built-in authentication — when exposing it beyond your machine, put it behind a reverse proxy with auth (Caddy `basic_auth`, nginx + htpasswd, Tailscale, etc.). +
+Build from source instead of pulling +
+ +```bash +docker compose -f deploy/docker-compose.yml up --build -d +``` + +
+ +> **Network access:** the container binds to `127.0.0.1` only. To reach OmniVoice from another machine on your LAN, change the port mapping to `"0.0.0.0:3900:3900"`. OmniVoice ships no built-in authentication — when exposing it beyond your machine, put it behind a reverse proxy with auth (Caddy `basic_auth`, nginx + htpasswd, Tailscale, etc.). ### Desktop App diff --git a/deploy/Dockerfile b/deploy/Dockerfile index bf76c812..11b0ffc6 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -36,8 +36,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install `uv` for blazing-fast reliable pip resolution RUN pip install --no-cache-dir uv -# Copy python packaging specs -COPY pyproject.toml uv.lock ./ +# Copy python packaging specs (README.md required by hatchling metadata) +COPY pyproject.toml uv.lock README.md ./ # Install the project (non-editable — no need for -e in containers). # Uses `uv` for exponentially faster resolution than plain pip. diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 1a6d51e7..efdbbcf6 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -19,9 +19,12 @@ services: # ── CPU mode (default) ────────────────────────────────────── omnivoice: - build: - context: .. - dockerfile: deploy/Dockerfile + image: ghcr.io/debpalash/omnivoice-studio:latest + # To build from source instead of pulling, comment out `image:` and + # uncomment the two lines below: + # build: + # context: .. + # dockerfile: deploy/Dockerfile container_name: omnivoice-studio ports: - "127.0.0.1:3900:3900" @@ -42,9 +45,10 @@ services: # ── GPU mode — activate with: docker compose --profile gpu up omnivoice-gpu: - build: - context: .. - dockerfile: deploy/Dockerfile + image: ghcr.io/debpalash/omnivoice-studio:latest + # build: + # context: .. + # dockerfile: deploy/Dockerfile container_name: omnivoice-studio-gpu profiles: ["gpu"] ports: diff --git a/uv.lock b/uv.lock index 8a9317e7..448453d9 100644 --- a/uv.lock +++ b/uv.lock @@ -2913,7 +2913,7 @@ wheels = [ [[package]] name = "omnivoice" -version = "0.2.4" +version = "0.2.7" source = { editable = "." } dependencies = [ { name = "accelerate" },