docker-beets icon indicating copy to clipboard operation
docker-beets copied to clipboard

[FEAT] Running the docker container without starting up a web instance

Open monksy opened this issue 9 months ago • 7 comments

Is this a new feature request?

  • [X] I have searched the existing issues

Wanted change

I would like to be able to query beets without standing up a web server here. This would run it as a CLI command

Reason for change

Need for this is that the importing and collection management isn't needed as a true server sense. The need is so that I can run this sporattically when needed.

Proposed code change

Adding environment varraible Adding conditional logic in the service d to not start up the beets server. Accept the arguements as what to run from the command line.

monksy avatar May 02 '24 22:05 monksy

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

github-actions[bot] avatar May 02 '24 22:05 github-actions[bot]

Regarding your need to run this sporattically, regardless of the web server running, it's not going to stop this functionality. Deploy the container then just run commands such as docker exec -u abc -it beets /bin/bash -c 'beet import /downloads' unless I'm missing something?

j0nnymoe avatar May 02 '24 22:05 j0nnymoe

That suggestion does work. However, to script this import, that means that I would have to do a:

start exec stop/kill

To be able to script the import. That assumes that the exec doesn't have any issues.

monksy avatar May 03 '24 05:05 monksy

Regardless of the web server running or not, you would need script something like that anyways?

j0nnymoe avatar May 03 '24 06:05 j0nnymoe

Even in a script with it's current state you'd still have to handle the management of the webserver. In the context of a single exectution run, thats a bit excessive.

monksy avatar May 06 '24 19:05 monksy

Mount a dummy run file in your container to override the service from starting:

        volumes:
            - '/your_path/run:/etc/s6-overlay/s6-rc.d/svc-beets/run:ro' # prevent beets web service from running

Contents of the /your_path/run file:

#!/usr/bin/with-contenv bash
# shellcheck shell=bash

#exec \
#    s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8337" \
#    s6-setuidgid abc beet web

beets web service no longer starts with the container:

# docker exec -t -i beets /bin/bash
root@5860d39bc47c:/# ps auxw | grep beet
root        45  0.0  0.0    216    76 ?        S    01:06   0:00 s6-supervise svc-beets
root       146  0.0  0.0    216    84 ?        S    01:06   0:00 /package/admin/s6-2.12.0.2/command/s6-svlisten1 -U -- /run/s6-rc/servicedirs/svc-beets /package/admin/s6-2.12.0.2/command/s6-svc -u -- /run/s6-rc/servicedirs/svc-beets
root       343  0.0  0.0   1604     4 pts/0    S+   01:07   0:00 grep beet

nopoz avatar May 25 '24 08:05 nopoz

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

LinuxServer-CI avatar Jun 24 '24 14:06 LinuxServer-CI

This issue is locked due to inactivity

github-actions[bot] avatar Sep 23 '24 14:09 github-actions[bot]