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

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

Open
1 task done
monksy opened this issue May 2, 2024 · 6 comments
Open
1 task done

Comments

@monksy
Copy link

monksy commented May 2, 2024

Is this a new feature request?

  • 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.

Copy link

github-actions bot commented May 2, 2024

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

@j0nnymoe
Copy link
Member

j0nnymoe commented May 2, 2024

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?

@monksy
Copy link
Author

monksy commented May 3, 2024

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.

@j0nnymoe
Copy link
Member

j0nnymoe commented May 3, 2024

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

@monksy
Copy link
Author

monksy commented May 6, 2024

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.

@nopoz
Copy link

nopoz commented May 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Issues
Development

No branches or pull requests

3 participants