mopidy.md 2.3 KB


title: mopidy date: 2024-12-20T14:59:45+08:00

lastmod: 2024-12-20T15:20:24+08:00

mopidy

version: '3.5'
services:
    mopidy:
        container_name: mopidy
        restart: always
      
        ## Run container as root
        # This is required to modify the PUID and PGID by entrypoint script
        user: root

        ## Run cointainer in privileged mode (can help with permission issues)
        # privileged: true

        ## Add container to audio group 
        # change group name or id to your system's audio group
        group_add:
            - audio
      
        ## Add audio device 
        # Change to your system's audio device
        #devices:
        #    - /dev/snd

        volumes:
            # Mopidy config files
            - './config:/config'
          
            # Local media dir
            - './media:/media:ro'
          
            # Store mopidy library and images on host (persistent)
            - './local:$HOME/local'
          
            # Keep spotify credetnials (persistent)
            - './.spotify:$HOME/spotify'

            ## Host Audio Support
            # --- ALSA ---
            # Mopidy Config: [audio] output=alsasink
            # Optional: If you have specific configurations or adjustments defined
            #- /etc/asound.conf:/etc/asound.conf
            #- /usr/share/alsa:/usr/share/alsa

            # --- PulseAudio ---
            # Mopidy Config: [audio] output=pulsesink
            # PulseAudio config (path should match with PUID)
            #- $XDG_RUNTIME_DIR/pulse/native:/tmp/pulseaudio.socket  # socket
        ports:
            - '6600:6600'   # JSON-RPC API and MPD protocol
            - '6680:6680'   # HTTP WebUI
          
        image: 'jojo141185/mopidy:latest'   # ImageName:Version
      
        environment: 
            # Set mopidy user and audio group id to match host's specific permissions
            #- PUID=1000
            #- PGID=29

            # PulseAudio server socket for communication (path should match with PUID)
            #- PULSE_SERVER=unix:/tmp/pulseaudio.socket
            #- PULSE_COOKIE=/tmp/pulseaudio.cookie  # (optional)
          
            # Install additional pip packages
            - PIP_PACKAGES=Mopidy-TuneIn Mopidy-Youtube yt-dlp Mopidy-Spotify