jbonjean / docker-public-images

Apache License 2.0
5 stars 3 forks source link

Cross-Origin message in browser console and ERR_CONNECTION_REFUSED #4

Open maxdd opened 3 years ago

maxdd commented 3 years ago

Hello, thank you for making this image. I started a container with the following command

docker run --restart=always -d --name volumio \
  -e HOST=http://192.168.1.52:3010 \
  -p 3010:3000 \
  -v /media/ubuntu/E432F8DB32F8B420/Audio/:/var/lib/mpd/music/:ro \
  -v /home/ubuntu/Desktop/volumio/data/:/data \
  --device /dev/snd \
  jbonjean/volumio

but while i can browse it nicely I keep receiving the following message in the console

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.1.52/api/host. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)

I've tried to open it from another machine (my desktop pc which is not hosting the docker container) and i receive GET http://192.168.1.52/api/host net::ERR_CONNECTION_REFUSED vendor-6d48b0e874.js:33

this message is also most likely the reason why when I hit "play" button nothing happens. Do you have any suggestion?

maxdd commented 3 years ago

even with those errors by using pulseaudio i was able to make it work

version: '3.2'

services:
  volumio:
    image: jbonjean/volumio
    container_name: volumio
    restart: unless-stopped
    ports:
      - '3000:3000'
    volumes:
      - /media/ubuntu/E432F8DB32F8B420/Audio/:/var/lib/mpd/music/Audio/:ro
      - /home/ubuntu/Music/:/var/lib/mpd/music/Music/:ro
      - /home/ubuntu/docker/volumio/data/:/data
      - /run/user/1000/pulse:/pulse:ro
    environment:
      - HOST=http://192.168.1.52:3000
      - PULSE_SERVER=unix:/pulse/native
      - PULSE_COOKIE_DATA=home/ubuntu/.config/pulse/cookie
      - HOST_USER=1000:1000
      - AUDIO_OUTPUT=pulse
    devices:
      - /dev/snd:/dev/snd

without pulseaudio i wasn't able to. I opened a ticket here if you want to help

https://github.com/volumio/Volumio2/issues/2163