feat: add Docker + web deployment support#161
Open
ageofalgo wants to merge 1 commit intojamiepine:mainfrom
Open
feat: add Docker + web deployment support#161ageofalgo wants to merge 1 commit intojamiepine:mainfrom
ageofalgo wants to merge 1 commit intojamiepine:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Docker + Web Deployment Support
Summary
Adds production-ready Docker support for running Voicebox as a self-contained web service (API + UI) without the Tauri desktop app. This implements the Docker deployment planned in DOCKER_DEPLOYMENT.md.
Motivation
Currently, Voicebox can only be used via the Tauri desktop app or by running the backend manually. This PR enables a simple
docker compose upworkflow that serves both the API and the web frontend from a single container — useful for headless servers, integration with other local tools, and anyone who doesn't want to install Python/Bun/Rust locally.Changes
New Files
Dockerfileweb/frontend, (2) Python deps compiled in builder, (3) slim runtime image with both frontend + backenddocker-compose.yml.dockerignoretauri/,landing/,docs/) and build artifacts for a lean imageModified Files
backend/main.pyGET /endpoint now servesindex.htmlwhen the frontend build is present (Docker), falls back to API JSON otherwise. Added conditional static file serving + SPA catch-all route, only activated when/app/frontend/exists — zero impact on existing non-Docker usage.Usage
Generated audio files appear in the
./output/directory (configurable via the bind-mount indocker-compose.yml).Architecture
Build Details
The Dockerfile uses a 3-stage build to keep the runtime image small:
frontendstage (oven/bun:1): Stripstauri/landingworkspaces frompackage.json, installs deps, runsvite build(skippingtscdue to pre-existing upstream type errors)backend-builderstage (python:3.11-slim): Installs Python deps including Qwen3-TTS into a prefixpython:3.11-slim): Copies built frontend + Python packages, runs as non-rootvoiceboxuser with health checkSecurity
127.0.0.1only (not accessible from network)Notes
web/build skips TypeScript checking (tsc) because there are pre-existing type errors in the sharedapp/source. Vite handles the build fine without strict type checking. These errors should be fixed upstream separately./app/frontend/exists (i.e., inside the Docker container). Running the backend outside Docker behaves exactly as before.huggingface-cachenamed volume ensures they persist across container rebuilds.Testing
docker compose buildsucceedsdocker compose up -dstarts containercurl http://localhost:17493/healthreturns healthy statushttp://localhost:17493/app/frontend/→ JSON response at/)