#4795·verdaccio

Web UI doesn't work as a sidecar for non-localhost URLs

Author: ThePlenkovCreated Aug 27, 2024Updated Oct 27, 2024
LabelsDockertopic: webtopic: url domain

Hi!

let me please share a simple devcontainer I'm running in Github codespaces:

yaml
version: '3.8'

services:
  devcontainer:
    # Using a Dockerfile is optional, but included for completeness.
    build:
      context: .
      dockerfile: Dockerfile

    volumes:
      # This is where VS Code should expect to find your project's source code and the value of "workspaceFolder" in .devcontainer/devcontainer.json
      - ..:/workspace:cached

    # Overrides default command so things don't shut down after the process ends.
    command: /bin/sh -c "while sleep 1000; do :; done"

  verdaccio:
    image: verdaccio/verdaccio
    ports:
      - 4873:4873
    # environment:
    #   - VERDACCIO_PUBLIC_URL=http://localhost:4873

So it starts my devcontainer and starts verdaccio as a sidecar service. I find it very convenient because it doesn't require adding extra dev dependencies to the project. However it is not possible to use webUI because it still tries to load resources from absolute localhost path image

I'm very wondering how much work would be by changing those absolute paths to relative that's how it can run on any host?

Thank you!