ParsonLabs Music

Docker

Deploy ParsonLabs Music to a Docker Container

Docker LogoMain ImagePodman LogoDockge Icon
docker-compose.yml
docker-compose-local.yml
Dockerfile
package.json

In order to tell the container where your media is located, we can simply edit both the /path/to/config and /path/to/music in the container.

Values to Edit

  • /path/to/config - This is the path where all of the ParsonLabs Music data will be stored
  • /path/to/music - This is the path to your music folder

Docker Run

docker run -d \
  --name parsonlabs-music \
  -p 1993:1993 \
  -v "/path/to/config:/ParsonLabsMusic" \
  -v "/path/to/music:/music" \
  --restart unless-stopped \
  ghcr.io/willkirkmanm/music

That's all! Once the container starts, you will see running on port 1993.

Docker Compose

In the root of the repository, you will see two files, docker-compose.yml and docker-compose-local.yml, these are used to deploy Music.

docker-compose.yml

This uses the image hosted on ghcr

docker-compose-local.yml

This uses will manually build the Dockerfile located in the root of the project

Editing docker-compose.yml

docker-compose.yml
services:
  music-server:
    image: ghcr.io/willkirkmanm/music
    container_name: parsonlabs-music
    ports:
      - "1993:1993"
    volumes:
      - "/path/to/config:/ParsonLabsMusic"
      - "/path/to/music:/music"
    restart: unless-stopped

Locally Building the Image

The same steps apply here, this is just for the users who would like to manually build the docker image instead of using the hosted one
docker-compose-local.yml
services:
  music-server:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: parsonlabs-music
    ports:
      - "1993:1993"
    volumes:
      - "/path/to/config:/ParsonLabsMusic"
      - "/path/to/music:/music"
    restart: unless-stopped

Starting music in docker-compose

To start music, when the volumes and environment variables have been set, run the command:

docker-compose up -d

If you would like to use the docker-compose-local.yml file, run this command which specifies the docker-compose-local.yml file.

docker-compose -f docker-compose-local.yml up -d

This will start ParsonLabs Music in a daemon

Info

Running the containers as a daemon or detached means that the containers will run in the background and means you can safely exit the console.

Deploying with Podman

To deploy ParsonLabs Music using Podman, you can follow similar steps to Docker. Here’s how you can do it:

Podman Run

podman run -d \
  --name parsonlabs-music \
  -p 1993:1993 \
  -v "/path/to/config:/ParsonLabsMusic" \
  -v "/path/to/music:/music" \
  --restart unless-stopped \
  ghcr.io/willkirkmanm/music

Podman Compose

If you prefer to use a compose file, you can use podman-compose with the same or files. Here’s how you can do it:

Using

podman-compose -f docker-compose.yml up -d

Using

podman-compose -f docker-compose-local.yml up -d

Info

Running the containers as a daemon or detached means that the containers will run in the background, allowing you to safely exit the console.

Changing Ports

What Ports do What?

  • 1993:1993 - This port handles the server and website of ParsonLabs Music.

Changing Port Mappings

If you need to change the port mappings, you can do so by changing the docker running scripts. For example, to change the external port from 1993 to 9000, you would update the port mapping as follows:

services:
  music-server:
    ...
    ports:
      - "9000:1993"
    ...

Environment variables

JWT Secret

The JWT Secret is used in authentication to sign and verify the JWT's that are recieved in the server are legitimate. Although Music randomly generates a JWT Secret everytime the server is restarted, it is possible to assign a custom secret through the environment variable JWT_SECRET=.

For example, for Docker run through adding the -e JWT_SECRET="your_super_secure_secret":

docker run -d \
  --name parsonlabs-music \
  ...
  -e JWT_SECRET="your_super_secure_secret" \
  --restart unless-stopped \
  ghcr.io/willkirkmanm/music

Similarly for docker-compose:

version: '3.8'
 
services:
  music-server:
    ...
    environment:
      JWT_SECRET: "your_super_secure_secret"
    ...

On this page