make redis server connection configurable through $REDIS_URL#277
make redis server connection configurable through $REDIS_URL#277semohr merged 4 commits intopSpitzner:release/2.0.0from
Conversation
|
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
|
I see that you have a new release coming up, so I'll wait for your lead on what to put in the changelog and where |
|
Hi @lina-bh, thanks for the PR. I think this is a good addition. I would make this part of 2.0. Please base the PR on the Also, we should document it in docs/configuration.md, ideally with a small sample compose file to showcase the benefits. best, |
|
Apologies for the delay. It's been a long time since I used docker-compose, I've been using Podman/Quadlets and Kubernetes for a while now, and I haven't keep dockerd and docker-compose around. Please let me know how you get on with the example in configuration.md. The DNS names for the containers should be resolvable within each other since docker-compose creates a network for each stack. |
semohr
left a comment
There was a problem hiding this comment.
Just tested the changes in a local dev setup which uses an external redis container:
services:
redis:
image: docker.io/library/redis:alpine
volumes:
- redis:/data
beets-flask:
container_name: beets-flask
hostname: beets-container
build:
context: ..
dockerfile: docker/Dockerfile
target: dev
image: beets-flask
restart: unless-stopped
ports:
- "5001:5001" # for beets-flask
- "5173:5173" # for vite dev server
environment:
# 502 is default on macos, 1000 on linux
USER_ID: 1000
GROUP_ID: 1000
LOG_LEVEL_BEETSFLASK: DEBUG
LOG_LEVEL_OTHERS: WARNING
REDIS_URL: redis://redis:6379/
volumes:
- ../local/music/:/music/
- ../local/config/:/config
- ../local/logs/:/logs
- ../:/repo/
volumes:
redis:Everything seems to work as expected.
Thanks for the addition!
|
Thanks for fixing that bit in the docs, I had noticed that but forgot to change it. |
|
No worries. Sorry for us being slow with responses and general fixes recently. Normally a simple addition like this sholdnt take a month to get merged 😨 Once we merge the other recent PRs, we gonna create a new release candidate and you can test it in your setup. Hopefully latest this weekend 🙃 |
So that a Redis instance outside of the container may be used, read the
REDIS_URLenvironment variable. If it is set and non-empty, assume it is aredis://protocol URL and connect to that instead of forking a Redis instance inside the container. This allows the well understood behaviour of a dedicated Redis image, or a Redis running outside a container, to be used, including more flexible logging and control over configuration.