Skip to content

[Bug] Unable to use pre-built Docker image when not using localhost #80

@loryanstrant

Description

@loryanstrant

Describe the bug

When OmniVoice Studio is deployed via Docker and accessed from another machine on the LAN, the web UI fails to communicate with the backend.

The frontend makes API and WebSocket requests to http://127.0.0.1:3900 / ws://127.0.0.1:3900/..., which only works when the browser is running on the same machine as the container host. From a LAN client, those requests point back to the client machine itself, causing repeated ERR_CONNECTION_REFUSED errors.

This results in UI failures such as:

  • Failed to load engines: Failed to fetch
  • Failed to log files: Failed to fetch
  • model/setup/status/system API calls failing
  • WebSocket connection failures for events
  • no visible model download/setup progress in the UI

Additionally, for LAN access, the backend also needs the browser origin included in OMNIVOICE_ALLOWED_ORIGINS.

To reproduce

Steps to reproduce the behavior:

  1. Deploy OmniVoice Studio using Docker on one machine
  2. Expose port 3900 on the LAN
  3. Access the UI from a different machine using a LAN hostname or IP, e.g. http://my-docker-host.local:3900
  4. Open browser DevTools
  5. See repeated failed requests to:
    • http://127.0.0.1:3900/model/status
    • http://127.0.0.1:3900/sysinfo
    • http://127.0.0.1:3900/setup/status
    • http://127.0.0.1:3900/system/logs?tail=300
    • ws://127.0.0.1:3900/ws/events

Expected behavior

When the app is served over Docker and accessed from the LAN, the frontend should communicate with the same host/origin that served the page, or otherwise support a documented/runtime-configurable API base suitable for remote browser access.

A LAN user visiting http://my-docker-host.local:3900 should not have the frontend hardcoded to 127.0.0.1:3900.

Screenshots / Logs

Browser console showed repeated errors like:

  • GET http://127.0.0.1:3900/model/status net::ERR_CONNECTION_REFUSED
  • GET http://127.0.0.1:3900/sysinfo net::ERR_CONNECTION_REFUSED
  • GET http://127.0.0.1:3900/setup/status net::ERR_CONNECTION_REFUSED
  • GET http://127.0.0.1:3900/system/logs?tail=300 net::ERR_CONNECTION_REFUSED
  • WebSocket connection to 'ws://127.0.0.1:3900/ws/events' failed

The frontend appears to default to 127.0.0.1 here:

const viteEnv = import.meta.env ?? {};
const _port = viteEnv.VITE_API_PORT || '3900';
export const API = viteEnv.VITE_API_URL || `http://127.0.0.1:${_port}`;

Environment

  • OS: Ubuntu Linux
  • Install method: Docker
  • Version: current latest container image at time of testing
  • GPU: NVIDIA GPU
  • RAM: N/A

Additional context

I was able to make it work by building from source and baking the LAN URL into the frontend build using VITE_API_URL, plus setting OMNIVOICE_ALLOWED_ORIGINS for the LAN origin.

Changes required

In a custom Docker build, I added frontend build-time support for VITE_API_URL:

ARG VITE_API_URL=http://127.0.0.1:3900
ENV VITE_API_URL=${VITE_API_URL}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions