giof71/yams

By giof71

Updated about 4 hours ago

Easily run yams, Yet Another Mpd Scrobbler

Image
0

2.4K

yams-docker

A Docker image for yams.

Available Archs on Docker Hub

  • linux/amd64
  • linux/arm/v7
  • linux/arm64/v8

References

First and foremost, the reference to the projects:

YamsMusic Player Daemon
Current version of yams if 0.7.3.

Links

Source: GitHub
Images: DockerHub

Why

I just wanted to be able to run yams using a docker container.
I wanted to be able to use it on Moode Audio also.

Prerequisites

See this page.
The page also covers docker installation on Moode Audio.

Get the image

Here is the repository on DockerHub.

Getting the image from DockerHub is as simple as typing:

docker pull giof71/yams

Usage

Volumes

The following tables lists the volumes:

VOLUMEDESCRIPTION
/dataApplication data. It is recommended to setup this volume.
Environment Variables
VARIABLEDESCRIPTION
USER_MODEDefaults to YES
PUIDUser id, defaults to 1000
PGIDGroup id, defaults to 1000
MPD_HOSTHost for Music Player daemon, defaults to localhost, which is generally correct when the container is run in host mode.
MPD_PORTDefaults to 6600
First run

The first run should be interactive, because you will receive the link to be opened in order to authorize yams to access your Last.FM account.
After this initial configuration, if you have setup the volume correctly, you will be able to run the container non interactively.

Example configuration

Please see the following docker-compose file:

---
version: "3"

networks:
  mpd-pulse:
    external: true

services:
  yams:
    image: giof71/yams:latest
    container_name: yams-pulse
    networks:
      - mpd-pulse
    environment:
      - TZ=Europe/Rome
      - PUID=1000
      - PGID=1000
      - MPD_HOST=mpd-pulse
    volumes:
      - ./data:/data

This container runs in the same docker network named mpd-pulse, so we can refer to mpd using its container name, assuming mpd is running in a docker container (see my repo here).
Another example, using host networking:

---
version: "3"

services:
  yams:
    image: giof71/yams:latest
    container_name: yams-pulse
    network_mode: host
    environment:
      - TZ=Europe/Rome
      - PUID=1000
      - PGID=1000
      - MPD_HOST=mpd-hostname.home.lan
      - MPD_PORT=6601
    volumes:
      - ./data:/data

This time we don't have a docker network, and if mpd is not running on localhost, we can specify hostname and port using MPD_HOST and MPD_PORT. Both can be omitted if the values are respectively localhost and 6600.
In both cases, for the first interactive run, execute the following:

docker-compose run yams

Please note that yams here is the name of the service in the docker-compose file.
Follow the instructions on the console, so open the link and authorized the application on Last.FM. Press enter on the console as requested.
After this step, you can simply stop the container (CTRL-C, maybe twice to trigger a kill), then restart it as usual with:

docker-compose up -d
Changes

See the following table.

DateDescription
2024-10-07Use exec so we can get rid of bash processes
2023-04-19Routine build after updates to the upstream project
2023-03-09Support for API_KEY and API_SECRET (#13)
2023-03-04Add apt proxy support (#4)
2023-03-04Removing existing pid before restart (#5)
2023-03-04Fixed volume in Dockerfile (#1)
2023-03-03Initial release

Docker Pull Command

docker pull giof71/yams