Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose #621

Open
BLACK4585 opened this issue Nov 12, 2024 · 7 comments
Open

Docker compose #621

BLACK4585 opened this issue Nov 12, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@BLACK4585
Copy link

Hey,
it would be great if you could add a docker compose file, since I have some problems creating the MQTT broker.
Also this would made it easier to get the whole app up and running.

@github-project-automation github-project-automation bot moved this to Needs Triage 🗃️ in Playnite-Web Nov 12, 2024
@BLACK4585
Copy link
Author

Okay seems like I got it up and running now, a quick hint to the mosquitto.conf to disable local mode etc would be nice.
But somehow nothing is synced though.
However, a compose file would still be appreciated.

@andrew-codes andrew-codes added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Nov 13, 2024
@kunla
Copy link

kunla commented Dec 27, 2024

The docker-compose file below worked for me on Windows 10 using my WSL hostname as the value.

services:
  mqtt:
    image: eclipse-mosquitto
    ports:
      - "0.0.0.0:1883:1883"
    volumes:
      - mqtt_data:/mosquitto/data
      - mqtt_log:/mosquitto/log
      - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
    restart: unless-stopped
    
  mongodb:
    image: mongo:focal
    ports:
      - "0.0.0.0:27017:27017"
    restart: unless-stopped
    
  playnite-web:
    image: ghcr.io/andrew-codes/playnite-web-app:10.1.0
    ports:
      - "0.0.0.0:3000:3000"
    environment:
      - PORT=3000
      - HOST=127.0.1.1
      - DB_HOST=mongodb
      - DB_PORT=27017
      - MQTT_HOST=mqtt
      - MQTT_PORT=1883
    volumes:
      - playnite_assets:/opt/playnite-web-app/public/assets/asset-by-id
    depends_on:
      - mqtt
      - mongodb
    restart: unless-stopped

volumes:
  mqtt_data:
  mqtt_log:
  playnite_assets:

I also created a file named mosquitto.conf with the contents:

listener 1883 0.0.0.0
allow_anonymous true

Create a directory containing both files above and run docker-compose up -d inside it.

@jamlaninov
Copy link

jamlaninov commented Jan 4, 2025

Your docker-compose file works flawlessly when connecting as localhost. When using the ip:port of the playnite-web instance, the page loads however the buttons on the page don't work (no login, filtering,...) possible. I use the docker-compose file in Docker Desktop for Windows.

When viewing the page with Web Developer Tools of Firefox active, multiple failed get requests are visible in the tab Networking, some mentioning CORS errors and others displaying https requests that error out. Adding 'ADDITIONAL_ORIGINS' and 'CSP_ORIGINS' as environment variables in the playnite-web service does not solve this problem.

Is there any way to connect to the playnite-web instance from another host?

@BLACK4585
Copy link
Author

I am currently not able to test since I'm not at home but try to remove the 0.0.0.0's in the port forwarding sections. Not sure how exactly this works but this has something to do with binding to a network.

@jamlaninov
Copy link

jamlaninov commented Jan 5, 2025

I removed 0.0.0.0 in the docker-compose file e.g.

 ports:
    - 27017:27017

I also did this for the others services and later tried adding quotes and after that also changing the 0.0.0.0 to the ip of the playnite-web host in the lan. These changes didn't solve the problem unfortunately.

One more thing: the MQTT service is reachable by inputting the lan ip of the service in the settings of the playnite-web plugin in Playnite and the Mongo service gives the same message when connecting to it using the lan ip:port in a web browser as when connecting to localhost. So it's only the playnite-web page that does not seem to respond correctly...

@BLACK4585
Copy link
Author

What happens if you remove the first line from the mosquitto conf? I created mine using ChatGPT and it also told me something about an ACL file. If this doesn't work for you, let me know and I can redirect it to you.
I'm home soon so I can try to assist you.

@jamlaninov
Copy link

Removing listener 1883 0.0.0.0 from mosquitto.conf didn't change anything. Any help is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Triaging 💅
Development

No branches or pull requests

4 participants